Skip to content
Snippets Groups Projects
  1. Jun 09, 2017
  2. Apr 08, 2017
  3. Mar 31, 2017
  4. Mar 30, 2017
    • Pierre-Yves David's avatar
      run-tests: auto-replace 'TXNID' output · 728d37353e1e
      Pierre-Yves David authored
      Hooks related to the transaction are aware of the transaction id. By definition
      this txn-id is unique and different for each transaction. As a result it can
      never be predicted in test and always needs matching. As a result, touching any
      like with this data is annoying. We solve the problem once and for all by
      installing an automatic replacement. In test, this will now show as:
      
        TXNID=TXN:$ID$
      728d37353e1e
  5. Jan 02, 2017
    • Gregory Szorc's avatar
      revlog: make compressed size comparisons consistent · 4215dc1b708b
      Gregory Szorc authored
      revlog.compress() compares the compressed size to the input size
      and throws away the compressed data if it is larger than the input.
      This is the correct thing to do, as storing compressed data that
      is larger than the input takes up more storage space and makes reading
      slower.
      
      However, the comparison was implemented inconsistently. For the
      streaming compression mode, we threw away the result if it was
      greater than or equal to the input size. But for the one-shot
      compression, we threw away the compression only if it was greater
      than the input size!
      
      This patch changes the comparison for the simple case so it is
      consistent with the streaming case.
      
      As a few tests demonstrate, this adds 1 byte to some revlog entries.
      This is because of an added 'u' header on the chunk. It seems
      somewhat wrong to increase the revlog size here. However, IMO the cost
      of 1 byte in storage is insignificant compared to the performance gains
      of avoiding decompression. This patch should invite questions around
      the heuristic for throwing away compressed data. For example, I'd argue
      we should be more liberal about rejecting compressed data, additionally
      doing so where the number of bytes saved fails to reach a threshold.
      But we can have this discussion another time.
      4215dc1b708b
  6. Oct 28, 2016
    • Katsunori FUJIWARA's avatar
      tests: use "?" to glob both ":" and ";" in output for test portability · fe612ab5eeff
      Katsunori FUJIWARA authored
      If environment variable looks like PATH or so (e.g. any of components
      joined by ":" contains "/"), ":" in it is replaced with ";" by MinGW
      at spawning Windows native process, to follow path concatenation style
      of Windows.
      
      Therefore, "bundle:../full.hg" is converted into "bundle;..\full.hg"
      on MinGW.
      
      Difference between "/" and "\" is automatically ignored by "(glob)",
      but difference between ":" and ";" should be globed explicitly.
      fe612ab5eeff
    • Katsunori FUJIWARA's avatar
      tests: invoke printenv.py via sh -c for test portability · 34a5f6c66bc5
      Katsunori FUJIWARA authored
      On Windows platform, invoking printenv.py directly via hook is
      problematic, because:
      
        - unless binding between *.py suffix and python runtime, application
          selector dialog is displayed, and running test is blocked at each
          printenv.py invocations
      
        - it isn't safe to assume binding between *.py suffix and python
          runtime, because application binding is easily broken
      
          For example, installing IDE (VisualStudio with Python Tools, or
          so) often requires binding between source files and IDE itself.
      
      This patch invokes printenv.py via sh -c for test portability. This is
      a kind of follow up for d19787db6fe0, which eliminated explicit
      "python" for printenv.py. There are already other 'sh -c "printenv.py"'
      in *.t files, and this fix should be reasonable.
      
      This changes were confirmed in cases below:
      
        - without any application binding for *.py suffix
        - with binding between *.py suffix and VisualStudio
      
      This patch also replaces "echo + redirection" style with "heredoc"
      style, because:
      
        - hook command line is parsed by cmd.exe as shell at first, and
        - single quotation can't quote arguments on cmd.exe, therefore,
        - "printenv.py foobar" should be quoted by double quotation, but
        - nested quoting (or tricky escaping) isn't readable
      34a5f6c66bc5
  7. Sep 25, 2016
  8. Sep 11, 2016
    • Katsunori FUJIWARA's avatar
      streamclone: clear caches after writing changes into files for visibility · 519a02267f90
      Katsunori FUJIWARA authored
      Before this patch, streamclone-ed changes are invisible via @filecache
      properties to in-process procedures before closing transaction
      (e.g. pretxnclose python hook), if corresponded property is cached
      before consumev1(). Strictly speaking, caching should occur inside
      (store) lock for transaction.
      
      repo.invalidate() after closing transaction is too late to force
      @filecache properties to be reloaded from changed files at next
      access.
      
      For visibility of streamclone-ed changes to in-process procedures
      before closing transaction, this patch clears caches just after
      writing changes into files.
      
      BTW, regardless of changing in this patch, clearing cached properties
      in consumev1() causes inconsistency, if (1) transaction is started and
      (2) any @filecache property is changed before consumev1().
      
      This patch also adds the comment to fix this (potential) inconsistency
      in the future.
      519a02267f90
  9. Jul 17, 2016
    • Gregory Szorc's avatar
      bundle2: store changeset count when creating file bundles · 953839de96ab
      Gregory Szorc authored
      The bundle2 changegroup part has an advisory param saying how many
      changesets are in the part. Before this patch, we were setting
      this part when generating bundle2 parts via the wire protocol but
      not when generating local bundle2 files.
      
      A side effect of not setting the changeset count part is that progress
      bars don't work when applying changesets. As the tests show, this
      impacted clone bundles, shelve, backup bundles, `hg unbundle`, and
      anything touching bundle2 files.
      
      This patch adds a backdoor to allow us to pass state from
      changegroup generation into the unbundler. We store the number
      of changesets in the changegroup in this state and use it to
      populate the aforementioned advisory part parameter when generating
      the bundle2 bundle.
      
      I concede that I'm not thrilled by how state is being passed in
      changegroup.py (it feels a bit hacky). I would love to overhaul the
      rather confusing set of functions in changegroup.py with something that
      passes rich objects around instead of e.g. low-level generators.
      However, given the code freeze for 3.9 is imminent, I'd rather not
      undertake this endeavor right now. This feels like the easiest way
      to get the parameter added to the changegroup part.
      953839de96ab
  10. Apr 14, 2016
  11. Mar 23, 2016
  12. Jan 19, 2016
    • Durham Goode's avatar
      bundle: exit early when there are no commits to bundle · 645e78845383
      Durham Goode authored
      Previously, if you passed a revset that resolved to no nodes, it would get
      interpreted by the changegroup discovery logic as 'bundle all my heads', which
      is not what the user asked.
      
      Let's exit early when we notice this case.
      
      It could be argued that the changeset discovery logic should be smarter and only
      assume 'all heads' if the incoming heads parameter is None, but that's a much
      riskier change.
      645e78845383
  13. Jan 15, 2016
  14. Jan 06, 2016
    • Mateusz Kwapich's avatar
      hooks: add HG_NODE_LAST to txnclose and changegroup hook environments · d6d3cf5fda6f
      Mateusz Kwapich authored
      Sometimes a txnclose or changegroup hook wants to iterate through all
      the changesets in transaction: in that situation usually the revset
      `$HG_NODE:` is used to select the revisions. Unfortunately this revset
      sometimes may contain too many changesets because we don't have the
      write lock while the hook runs newer changes may be added to
      repository in the meantime.
      
      That's why there is a need for extra variable carrying the information about
      the last change in the transaction.
      d6d3cf5fda6f
  15. Dec 05, 2015
    • Martin von Zweigbergk's avatar
      revlog: don't consider nullrev when choosing delta base · d9bfe6289acf
      Martin von Zweigbergk authored
      In the most complex case, we try using the incoming delta base, then
      we try both parents, and then we try the previous revlog entry. If
      none of these result in a good delta, we natually use the null
      revision as base. However, we sometimes consider the nullrev before we
      have exhausted our other options. Specifically, when both parents are
      null, we use the nullrev as delta base if it produces a good delta
      (according to _isgooddelta()), and we fail to try the previous revlog
      entry as delta base. After 20a9226bdc8a (addrevision: use general
      delta when the incoming base delta is bad, 2015-12-01), it can also
      happen for non-merge commits when the incoming delta is not good.
      
      The Firefox repo (from many months back) shrinks a tiny bit with this
      patch: from 1.855GB to 1.830GB (1.4%). The hg repo itself shrinks even
      less: by less than 0.1%. There may be repos that get larger instead.
      
      This undoes the unexplained test change in 20a9226bdc8a.
      d9bfe6289acf
  16. Dec 02, 2015
    • Pierre-Yves David's avatar
      addrevision: use general delta when the incoming base delta is bad · 20a9226bdc8a
      Pierre-Yves David authored
      We unify the delta selection process to be a simple three options process:
      
      - try to use the incoming delta (if lazydeltabase is on)
      - try to find a suitable parents to delta against (if gd is on)
      - try to delta against the tipmost revision
      
      The first of this option that yield a valid delta will be used.
      
      The test change in 'test-generaldelta.t' show this behavior as we use a delta
      against the parent instead of a full delta when the incoming delta is not
      suitable.
      
      This as some impact on 'test-bundle.t' because a delta somewhere changes. It
      does not seems to change the test semantic and have been ignored.
      20a9226bdc8a
  17. Oct 20, 2015
    • Pierre-Yves David's avatar
      test: use generaldelta for test-bundle.t · 608cabec1b15
      Pierre-Yves David authored
      This impacts tests of the 'packed' feature. We can safely accept the new output
      because the 'v1' format is not restricted to old revlog format, the requirements
      are properly advertised to the client.
      608cabec1b15
  18. Oct 15, 2015
    • Gregory Szorc's avatar
      commands: support consuming stream clone bundles · bde7ef23340d
      Gregory Szorc authored
      For the same reasons that we don't produce stream clone bundles with `hg
      bundle`, we don't support consuming stream clone bundles with `hg
      unbundle`. We introduce a complementary debug command for applying
      stream clone bundles. This command is mostly to facilitate testing.
      Although it may be used to manually apply stream clone bundles until a
      more formal mechanism is (possibly) adopted.
      bde7ef23340d
  19. Oct 17, 2015
    • Gregory Szorc's avatar
      commands: support creating stream clone bundles · 43708f92f471
      Gregory Szorc authored
      Now that we have support for recognizing the streaming clone bundle
      type, add a debug command for creating them.
      
      I decided to create a new debug command instead of adding support to `hg
      bundle` because stream clone bundles are not exactly used the same way
      as normal bundle files and I don't want to commit to supporting them
      through the official `hg bundle` command forever. A debug command,
      however, can be changed without as much concern for backwards
      compatibility.
      
      As part of this, `hg bundle` will explicitly reject requests to produce
      stream bundles.
      
      This command will be required by server operators using stream clone
      bundles with the clone bundles feature.
      43708f92f471
  20. Sep 30, 2015
  21. Jun 08, 2015
  22. May 10, 2015
    • Pierre-Yves David's avatar
      progress: get the extremely verbose output out of default debug · bd625cd4e5e7
      Pierre-Yves David authored
      When the progress extension is not enabled, each call to 'ui.progress' used to
      issue a debug message. This results is a very verbose output and often redundant
      in tests. Dropping it makes tests less volatile to factor they do not meant to
      test.
      
      We had to alter the sed trick in 'test-rename-merge2.t'. Sed is used to drop all
      output from a certain point and hidding the progress output remove its anchor.
      So we anchor on something else.
      bd625cd4e5e7
  23. Apr 15, 2015
  24. Dec 18, 2014
    • Eric Sumner's avatar
      bundlerepo: retract phase boundary · e7fcf58acd71
      Eric Sumner authored
      This patch makes bundrepo retract the phase boundary for new commits to 'draft'
      status, which is consistent with the behavior of 'hg unbundle'.  The old
      behavior was for commits to appear with the same phase as their nearest
      ancestor in the base repository.
      
      This affects several classes of operation:
      
      * Inspecting a bundle with the -B flag
      * Treating a bundle file as a peer (old: everything public, new: everything draft)
      * Incoming command (neither old or new behavior is sensible -- fixed in next patch)
      e7fcf58acd71
  25. Oct 16, 2014
    • Mike Hommey's avatar
      changegroup: use a copy of hookargs when invoking the changegroup hook · 7c13c9404c2c
      Mike Hommey authored
      addchangegroup creates a runhook function that is used to invoke the
      changegroup and incoming hooks, but at the time the function is called,
      the contents of hookargs associated with the transaction may have been
      modified externally. For instance, bundle2 code affects it with
      obsolescence markers and bookmarks info.
      
      It also creates problems when a single transaction is used with multiple
      changegroups added (as per an upcoming change), whereby the contents
      of hookargs are that of after adding a latter changegroup when invoking
      the hook for the first changegroup.
      7c13c9404c2c
  26. Oct 12, 2014
  27. Aug 15, 2014
  28. Apr 13, 2014
  29. Feb 25, 2014
    • Piotr Klecha's avatar
      pull: close peer repo on completion (issue2491) (issue2797) · 7f865a94691e
      Piotr Klecha authored
      When pulling changes from a compressed bundle Mercurial first uncompresses it
      to a temporary file in .hg directory. This file will not be deleted unless
      the bundlerepo (other) is explicitly closed.
      
      This is similar to cleanup that occurs after incoming.
      7f865a94691e
  30. Feb 17, 2013
    • Katsunori FUJIWARA's avatar
      bundle: treat branches created newly on the local correctly (issue3828) · 61c8327ced50
      Katsunori FUJIWARA authored
      Before this patch, "hg bundle --branch foo other" fails to create
      bundle file, if specified "foo" branch is created newly on the local
      repository.
      
      "hg bundle" uses "hg.addbranchrevs(repo, other, ...)" to look branch
      names up, even though other outgoing-like implementation uses
      "hg.addbranchrevs(repo, repo, ...)". In the former invocation, "other"
      repository recognizes such branches as unknown, so execution is
      aborted.
      
      This patch uses "hg.addbranchrevs(repo, repo, ..)" in "hg bundle" to
      bundle revisions on such branches correctly.
      61c8327ced50
  31. Oct 31, 2012
  32. Jul 06, 2012
    • Katsunori FUJIWARA's avatar
      localrepo: use the path relative to "self.vfs" instead of "path" argument · 36a3016811d1
      Katsunori FUJIWARA authored
      As a part of migration to vfs, this patch uses "self.root", which can
      be recognized as the path relative to "self.vfs", instead of "path"
      argument.
      
      This fix allows to make invocations of "util.makedirs()" and
      "os.path.exists()" while ensuring repository directory in
      "localrepository.__init__()" ones indirectly via vfs.
      
      But this fix also raises issue 2528: "hg clone" with empty destination.
      
      "path" argument is empty in many cases, so this issue can't be fixed
      in the view of "localrepository.__init__()".
      
      Before this patch, it is fixed by empty-ness check ("not name") of
      exception handler in "util.makedirs()".
      
          try:
              os.mkdir(name)
          except OSError, err:
              if err.errno == errno.EEXIST:
                  return
              if err.errno != errno.ENOENT or not name:
                  raise
      
      This requires "localrepository.__init__()" to invoke "util.makedirs()"
      with "path" instead of "self.root", because empty "path" is treated as
      "current directory" and "self.root" becomes valid path.
      
      But "hg clone" with empty destination can be detected also in
      "hg.clone()" before "localrepository.__init__()" invocation, so this
      patch re-fixes issue2528 by checking it in "hg.clone()".
      36a3016811d1
  33. Jun 21, 2012
  34. Jun 20, 2012
  35. Jun 16, 2012
  36. Jun 10, 2012
    • kiilerix's avatar
      tests: add missing trailing 'cd ..' · f2719b387380
      kiilerix authored
      Many tests didn't change back from subdirectories at the end of the tests ...
      and they don't have to. The missing 'cd ..' could always be added when another
      test case is added to the test file.
      
      This change do that tests (99.5%) consistently end up in $TESTDIR where they
      started, thus making it simpler to extend them or move them around.
      f2719b387380
    • Adrian Buehlmann's avatar
      test-bundle: enable for Windows · a1a57d3fe0eb
      Adrian Buehlmann authored
      a1a57d3fe0eb
  37. May 12, 2012
    • Sune Foldager's avatar
      bundle: make bundles more portable (isue3441) · 025b3b763ba9
      Sune Foldager authored
      This is achieved by acting as if the user had given -r<rev> for each head rev
      of outgoing changesets on the command line, as well as appropriate
      --base <rev>.
      
      The discovery information is computed as normal, and then adjusted as above.
      025b3b763ba9
Loading