Skip to content
Snippets Groups Projects
  1. Feb 22, 2025
  2. Feb 07, 2023
    • Pierre-Yves David's avatar
      test: explicitly "add" file before some commit in test-keyword.t · 93d72a7dd486
      Pierre-Yves David authored
      `hg commit -A` will revert the `hg addremove` step if the commit fails. However
      `hg rollback` currently does not.
      
      We are about to improve internal consistency around transaction and dirstate
      and the behavior of `hg rollback` will align on the other behavior in the
      process.
      
      Before doing so, we make sure the test is using a separate call to `hg add` to
      avoid the test scenario to be affected by that future change.
      
      note: the behavior change for `hg rollback` seems fine as it affect a niche
      usecase and `hg rollback` usage have been strongly discouraged for a while.
      93d72a7dd486
  3. May 02, 2022
  4. Feb 20, 2022
  5. Oct 07, 2020
  6. Oct 27, 2019
    • Denis Laxalde's avatar
      tests: handle Message-Id email header possible wrapping · 4128ffba4431
      Denis Laxalde authored
      The "Message-Id" header will get wrapped with a new line when exceeding
      75 characters on Python 3 (see changeset 7d4f2e4899c5 introducing usage
      of email.header.Header.encode and respective doc). This will occur in an
      unpredictable manner depending on the hostname's length. To make the
      test output consistent across Python versions and hostname
      configuration, we add a filter to unwrap this header value.
      4128ffba4431
  7. Jun 20, 2019
  8. Jun 28, 2019
  9. Apr 04, 2019
    • Denis Laxalde's avatar
      interactive: do not prompt about files given in command line · db72f9f6580e
      Denis Laxalde authored
      For commit and revert commands with --interactive and explicit files
      given in the command line, we now skip the invite to "examine changes to
      <file> ? [Ynesfdaq?]". The reason for this is that, if <file> is
      specified by the user, asking for confirmation is redundant.
      
      In patch.filterpatch(), we now use an optional "match" argument to
      conditionally call the prompt() function when entering a new "header"
      item. We use .exact() method to compare with files from the "header" in
      order to only consider (rel)path patterns.
      
      Add tests with glob patterns for commit and revert, to make sure we
      still ask to examine files in these cases.
      db72f9f6580e
  10. Oct 16, 2018
  11. Oct 13, 2018
  12. Oct 02, 2018
  13. Sep 29, 2018
  14. Sep 04, 2018
  15. Aug 29, 2018
    • Boris Feld's avatar
      phase: report number of non-public changeset alongside the new range · 89630d0b3e23
      Boris Feld authored
      When interacting with non-publishing repository or bundle, it is useful to
      have some information about the phase of the changeset we just pulled.
      
      This changeset updates the "new changesets MIN:MAX" output to also includes
      phases information for non-public changesets. Displaying extra data about
      non-public changesets means the output for exchange with publishing repository
      (the default) is unaffected.
      89630d0b3e23
  16. Jul 16, 2018
  17. Jul 08, 2018
    • Matt Harbison's avatar
      hook: add support for disabling the shell to native command translation · 38dfd308fe9d
      Matt Harbison authored
      I think having it on by default is the right thing to do, but this is an escape
      hatch if someone has a command that shouldn't be mangled.  The inspiration is
      the priority prefix.  The translation does nothing on non Windows platforms, so
      the default value is selected to avoid printing a useless note by default.
      38dfd308fe9d
  18. Apr 05, 2018
  19. Apr 03, 2018
    • Gregory Szorc's avatar
      tests: use `hg unbundle` instead of `hg pull` in some tests · 5d10f41ddcc4
      Gregory Szorc authored
      `hg pull <bundle>` uses the special "bundlerepo" repository. The
      bundlerepo code makes many assumptions about the storage of
      repositories. It will be difficult to teach bundlerepo to use
      non-revlog storage before a better storage interface is established.
      
      Many test failures using our "simple store" are related to
      bundlerepo: the simple store just isn't compatible with bundlerepo
      because of storage assumptions in bundlerepo.
      
      In order to mitigate the impact of bundlerepo on our code base,
      this commit changes various tests to use `hg unbundle` instead
      of `hg pull`. This bypasses the bundlerepo code.
      
      Tests exercising exchange functionality have not been altered, as
      they should be using `hg pull` and going through the bundlerepo
      code paths.
      
      Differential Revision: https://phab.mercurial-scm.org/D3059
      5d10f41ddcc4
  20. Jan 08, 2018
    • Pulkit Goyal's avatar
      merge: add `--abort` flag which can abort the merge · 41ef02ba329b
      Pulkit Goyal authored
      Currently we don't have a good functionality to abort the merge and tell user to
      do `hg update -C .` which can leads to different results if user missed the '.'
      and moreover does not align with other abort functionalities like rebase, shelve
      etc.
      
      This patch adds `hg merge --abort` which will abort the ongoing merge and take
      us back to the chagneset where we started from. Works in both cases when merge
      resulted in conflicts and when there were no conflicts.
      
      .. feature::
      
          A `--abort` flag to merge command to abort the ongoing merge.
      
      Differential Revision: https://phab.mercurial-scm.org/D1829
      41ef02ba329b
  21. Jan 11, 2018
  22. Dec 11, 2017
    • Matt Harbison's avatar
      tests: remove (glob) annotations that were only for '\' matches · 4441705b7111
      Matt Harbison authored
      # skip-blame because this was mechanically rewritten the following script.  I
      ran it on both *.t and *.py, but none of the *.py changes were proper.  All *.t
      ones appear to be, and they run without addition failures on both Windows and
      Linux.
      
        import argparse
        import os
        import re
      
        ap = argparse.ArgumentParser()
        ap.add_argument('path', nargs='+')
        opts = ap.parse_args()
      
        globre = re.compile(r'^(.*) \(glob\)(.*)$')
      
        for p in opts.path:
            tmp = p + '.tmp'
            with open(p, 'rb') as src, open(tmp, 'wb') as dst:
                for line in src:
                    m = globre.match(line)
                    if not m or '$LOCALIP' in line or '*' in line:
                        dst.write(line)
                        continue
                    if '?' in line[:-3] or ('?' in line[:-3] and line[-3:] != '(?)'):
                        dst.write(line)
                        continue
                    dst.write(m.group(1) + m.group(2) + '\n')
            os.unlink(p)
            os.rename(tmp, p)
      4441705b7111
  23. Oct 12, 2017
    • Denis Laxalde's avatar
      transaction-summary: show the range of new revisions upon pull/unbundle (BC) · eb586ed5d8ce
      Denis Laxalde authored
      Upon pull or unbundle, we display a message with the range of new revisions
      fetched. This revision range could readily be used after a pull to look out
      what's new with 'hg log'. The algorithm takes care of filtering "obsolete"
      revisions that might be present in transaction's "changes" but should not be
      displayed to the end user.
      eb586ed5d8ce
  24. Sep 26, 2017
  25. Aug 22, 2017
  26. Jun 25, 2017
    • Katsunori FUJIWARA's avatar
      keyword: add test for keyword expansion at serving multiple repositories · cf0da12afe8a
      Katsunori FUJIWARA authored
      This is safety for subsequent (and future) patches, which change
      function wrapping.
      cf0da12afe8a
    • Katsunori FUJIWARA's avatar
      keyword: make comparison webcommand suppress keyword expansion · 0afdc1a4f925
      Katsunori FUJIWARA authored
      Before this patch, diff in "comparison" webcommand doesn't suppress
      keyword expansion as same as diff output of other webcommands.
      0afdc1a4f925
    • Katsunori FUJIWARA's avatar
      keyword: restore kwtemplater.match at the end of wrapped webcommands · 9062458febca
      Katsunori FUJIWARA authored
      Before this patch, kwweb_skip doesn't restore kwtemplater.match after
      wrapped webcommands. This suppresses keyword expansion at wrapped
      webcommands.
      
      Typical usecase of this issue is "file" webcommand after annotate,
      changeset, filediff or so on.
      
      To ensure kwtemplater.match=util.never while original webcommand
      running, this patch makes kwweb_skip yield values returned by it,
      because it returns generator object.
      9062458febca
    • Katsunori FUJIWARA's avatar
      keyword: restore kwtemplater.restrict at the end of wrapped patch.diff · 7f569ce30216
      Katsunori FUJIWARA authored
      Before this patch, kwdiff doesn't restore kwtemplater.restrict after
      invocation of wrapped patch.diff(). This suppresses keyword expansion
      at subsequent filelog.read().
      
      Typical usecase of this issue is "hg cat" after "hg diff" with command
      server. In this case, kwtemplater.restrict=True is kept in command
      server process even after "hg diff".
      
      To ensure kwtemplater.restrict=True while original patch.diff()
      running, this patch makes kwdiff() yield values returned by it,
      because it returns generator object.
      
      Strictly speaking, if filelog.read() is invoked before completely
      evaluating the result of previous patch.diff(), keyword expansion is
      still suppressed, because kwtemplater.restrict isn't restored yet.
      
      But this fixing should be reasonable enough, because patch.diff() is
      consumed immediately, AFAIK.
      7f569ce30216
  27. May 02, 2017
    • Pierre-Yves David's avatar
      caches: move the 'updating the branch cache' message in 'updatecaches' · c2380b448265
      Pierre-Yves David authored
      We are about to remove the branchmap cache update in changegroup application.
      There is a debug message alongside this update that we do not want to loose. We
      move the message beforehand to simplify the test update in the next changeset.
      The message move is quite noisy and isolating that noise is useful.
      
      Most tests update are just line reordering since the message is issued at a
      later point during the transaction.
      
      After this changes, the message is displayed in more case since local commit
      creation also issue it.
      c2380b448265
  28. Nov 19, 2016
    • Kostia Balytskyi's avatar
      conflicts: make spacing consistent in conflict markers · ce3a133f71b3
      Kostia Balytskyi authored
      The way default marker template was defined before this patch,
      the spacing before dash in conflict markes was dependent on
      whether changeset is a tip one or not. This is a relevant part
      of template:
          '{ifeq(tags, "tip", "", "{tags} "}'
      If revision is a tip revision with no other tags, this would
      resolve to an empty string, but for revisions which are not tip
      and don't have any other tags, this would resolve to a single
      space string. In the end this causes weirdnesses like the ones
      you can see in the affected tests.
      
      This is a not a big deal, but double spacing may be visually
      less pleasant.
      
      Please note that test changes where commit hashes change are
      the result of marking files as resolved without removing markers.
      ce3a133f71b3
  29. Oct 07, 2016
  30. Jul 27, 2016
  31. Mar 29, 2016
  32. Jan 15, 2016
  33. Dec 01, 2015
    • Katsunori FUJIWARA's avatar
      commands: make commit acquire locks before processing (issue4368) · a01d3d32b53a
      Katsunori FUJIWARA authored
      Before this patch, "hg commit" (process A) executes steps below:
      
        1. get current branch heads via 'repo.branchheads()'
           - cache 'repo.changelog'
        2. invoke 'repo.commit()'
        3. acquire wlock
           - invalidate 'repo.dirstate'
        4. access 'repo.dirstate'
           - re-read '.hg/dirstate'
           - check validity of parent revisions with 'repo.changelog'
        5. invoke 'repo.commitctx()'
        6. acquire store lock (slock)
           - invalidate 'repo.changelog'
        7. do committing
        8. release slock
        9. release wlock
       10. check new branch head (via 'cmdutil.commitstatus()')
      
      If acquisition of wlock at (3) above waits for another "hg commit"
      (process B) or so running parallelly to release wlock, process A
      causes creating orphan revision, because:
      
        - '.hg/dirstate' refers the revision, which is newly added by
          process B, as its parent
      
        - but already cached 'repo.changelog' doesn't contain such revision
      
        - therefore, validating parents of '.hg/dirstate' at (4) above
          replaces such revision with 'nullid'
      
      Then, process A creates "orphan" revision, of which parent is "null"
      revision.
      
      In addition to it, "created new head" may be shown at the end of
      process A unintentionally, if store is updated parallelly, because
      both getting branch heads (1) and checking new branch head (10) are
      executed outside slock scope.
      
      To avoid this issue, this patch makes "hg commit" acquire wlock and
      slock before processing.
      
      This patch resolves the issue between "hg commit" processes, but not
      one between "hg commit" and other commands. Subsequent patches resolve
      the latter.
      
      Even after this patch, there are still corner case problems below:
      
        - filecache may overlook changes of '.hg/dirstate', and it causes
          similar issue (see below for detail)
      
          https://bz.mercurial-scm.org/show_bug.cgi?id=4368#c10
      
        - 3rd party extension may cause similar issue, if it directly uses
          'repo.commit()' without acquisition of wlock and slock
      
          This can be fixed by acquisition of slock at the beginning of
          'repo.commit()', but it seems suitable for "default" branch
      
          In fact, acquisition of slock itself is already introduced at
          "default" branch by 4414d500604f, but acquisition is not at the
          beginning of 'repo.commit()'.
      
      This patch also changes some tests:
      
        - test-fncache.t needs this tricky wrapping, to release (= forced
          failure of) wlock certainly
      
        - order of "hg commit" output is changed by widening scope of locks,
          because some hooks are fired after releasing wlock
      a01d3d32b53a
  34. Nov 23, 2015
    • Siddharth Agarwal's avatar
      shelve: use colon instead of quotes in 'changes to' description · 156985f2dec0
      Siddharth Agarwal authored
      If detailed conflict markers are enabled and the closing quote gets truncated,
      editors will often screw syntax highlighting up from that point because they'll
      see an opening quote and think it's the beginning of a string.
      
      In tests, the hashes change because the commit messages of the shelved bundles
      also change.
      156985f2dec0
  35. Oct 09, 2015
    • Siddharth Agarwal's avatar
      simplemerge: move conflict warning message to filemerge · ef1eb6df7071
      Siddharth Agarwal authored
      The current output for a failed merge with conflict markers looks something like:
      
        merging foo
        warning: conflicts during merge.
        merging foo incomplete! (edit conflicts, then use 'hg resolve --mark')
        merging bar
        warning: conflicts during merge.
        merging bar incomplete! (edit conflicts, then use 'hg resolve --mark')
      
      We're going to change the way merges are done to perform all premerges before
      all merges, so that the output above would look like:
      
        merging foo
        merging bar
        warning: conflicts during merge.
        merging foo incomplete! (edit conflicts, then use 'hg resolve --mark')
        warning: conflicts during merge.
        merging bar incomplete! (edit conflicts, then use 'hg resolve --mark')
      
      The 'warning: conflicts during merge' line has no context, so is pretty
      confusing.
      
      This patch will change the future output to:
      
        merging foo
        merging bar
        warning: conflicts while merging foo! (edit, then use 'hg resolve --mark')
        warning: conflicts while merging bar! (edit, then use 'hg resolve --mark')
      
      The hint on how to resolve the conflicts makes this a bit unwieldy, but solving
      that is tricky because we already hint that people run 'hg resolve' to retry
      unresolved merges. The 'hg resolve --mark' mostly applies to conflict marker
      based resolution.
      ef1eb6df7071
  36. Jun 08, 2015
  37. Apr 23, 2015
    • Laurent Charignon's avatar
      record: edit patch of newly added files (issue4304) · 8133494accf1
      Laurent Charignon authored
      I tried to fix this issue in the past and had to revert the fix. This is a
      second attempt without the regression we found with the first one.
      
      record defines special headers (of file) as headers whose hunk are not shown
      to the user for editing, they are used to represent deleted, moved and new
      files. Since we want to authorize editing the patch of newly added file we
      make the newly added file with some content not special anymore. This entails
      that we have to save their content before applying the backup to be able to
      revert it if the patch does not apply properly.
      We reintroduce the test showing that newly added files can be edited and that
      their content is shown to the user.
      8133494accf1
Loading