Skip to content
Snippets Groups Projects
  1. Jan 11, 2018
  2. Dec 11, 2017
    • Matt Harbison's avatar
      tests: remove (glob) annotations that were only for '\' matches · 4441705b
      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)
      4441705b
  3. Oct 12, 2017
    • Denis Laxalde's avatar
      transaction-summary: show the range of new revisions upon pull/unbundle (BC) · eb586ed5
      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.
      eb586ed5
  4. Sep 26, 2017
  5. Aug 22, 2017
  6. Jun 25, 2017
    • Katsunori FUJIWARA's avatar
      keyword: add test for keyword expansion at serving multiple repositories · cf0da12a
      Katsunori FUJIWARA authored
      This is safety for subsequent (and future) patches, which change
      function wrapping.
      cf0da12a
    • Katsunori FUJIWARA's avatar
      keyword: make comparison webcommand suppress keyword expansion · 0afdc1a4
      Katsunori FUJIWARA authored
      Before this patch, diff in "comparison" webcommand doesn't suppress
      keyword expansion as same as diff output of other webcommands.
      0afdc1a4
    • Katsunori FUJIWARA's avatar
      keyword: restore kwtemplater.match at the end of wrapped webcommands · 9062458f
      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.
      9062458f
    • Katsunori FUJIWARA's avatar
      keyword: restore kwtemplater.restrict at the end of wrapped patch.diff · 7f569ce3
      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.
      7f569ce3
  7. May 02, 2017
    • Pierre-Yves David's avatar
      caches: move the 'updating the branch cache' message in 'updatecaches' · c2380b44
      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.
      c2380b44
  8. Nov 19, 2016
    • Kostia Balytskyi's avatar
      conflicts: make spacing consistent in conflict markers · ce3a133f
      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.
      ce3a133f
  9. Oct 07, 2016
  10. Jul 27, 2016
  11. Mar 29, 2016
  12. Jan 15, 2016
  13. Dec 01, 2015
    • Katsunori FUJIWARA's avatar
      commands: make commit acquire locks before processing (issue4368) · a01d3d32
      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
      a01d3d32
  14. Nov 23, 2015
    • Siddharth Agarwal's avatar
      shelve: use colon instead of quotes in 'changes to' description · 156985f2
      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.
      156985f2
  15. Oct 09, 2015
    • Siddharth Agarwal's avatar
      simplemerge: move conflict warning message to filemerge · ef1eb6df
      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.
      ef1eb6df
  16. Jun 08, 2015
  17. Apr 23, 2015
    • Laurent Charignon's avatar
      record: edit patch of newly added files (issue4304) · 8133494a
      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.
      8133494a
  18. Apr 22, 2015
  19. Mar 06, 2015
    • Laurent Charignon's avatar
      record: allow editing new files (issue4304) · 79fceed6
      Laurent Charignon authored
      While using the record extension to select changes, the user couldn't see the
      content of newly added files and had to select/reject them based on filename.
      The test is changed accordingly in two places.
      79fceed6
  20. Apr 18, 2014
  21. Dec 18, 2014
    • Eric Sumner's avatar
      bundlerepo: retract phase boundary · e7fcf58a
      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)
      e7fcf58a
  22. Dec 21, 2014
    • Christian Ebert's avatar
      keyword: handle resolve to either parent · cb9d8454
      Christian Ebert authored
      Merged files are considered modified at commit time even if only 1 parent
      differs. In this case we must use the change context of this parent for
      expansion.
      
      The issue went unnoticed for long because it is only apparent until the next
      update to the merge revision - except in test-keyword where it was always
      staring us in the face.
      cb9d8454
    • Christian Ebert's avatar
      keyword: update test file syntax · bb679344
      Christian Ebert authored
      bb679344
  23. Sep 30, 2014
  24. Jul 26, 2014
  25. Jun 23, 2014
  26. Jun 09, 2014
  27. Jun 05, 2014
    • Katsunori FUJIWARA's avatar
      keyword: suppress keyword expansion while 'hg fetch' for internal merge · 2668a78d
      Katsunori FUJIWARA authored
      Before this patch, 'hg fetch' may cause unexpected conflict, if 'hg
      fetch'-ed changes are located near lines in which keywords are
      embedded, because keywords are substituted with other strings in the
      working directory.
      
      This patch suppresses keyword expansion while 'hg fetch' for internal
      merge by adding 'fetch' to 'restricted' command list like 'merge'.
      
      This patch uses 'hg import' to safely create the new head to be merged
      at succeeding 'hg fetch', because:
      
        - branch of revision #10 is different from one of #11 in 'Test'
          repository, so just 'hg fetch -r 11' doesn't cause merging between
          them
      
          this means the new head should be created manually.
      
        - 'hg import' is easier and safer than 'cat <<EOF' and 'hg commit'
          to replay same changes including special characters like '$'
      
          safeness of 'hg import' with keyword extension is already examined
          in 'test-keyword.t'.
      2668a78d
    • Katsunori FUJIWARA's avatar
      keyword: suppress keyword expansion while 'hg histedit' for internal merge · e22cfd1a
      Katsunori FUJIWARA authored
      Before this patch, 'hg histedit' may cause unexpected conflict, if 'hg
      histedit'-ed changes are located near lines in which keywords are
      embedded, because keywords are substituted with other strings in the
      working directory.
      
      This patch suppresses keyword expansion while 'hg histedit' for
      internal merge by adding 'histedit' to 'restricted' command list like
      'merge'.
      
      Test in this patch just swaps order of revision #13 and #14: this is
      enough to cause internal merge.
      e22cfd1a
    • Katsunori FUJIWARA's avatar
      keyword: suppress keyword expansion while 'hg backout' for internal merge · 5c64c338
      Katsunori FUJIWARA authored
      Before this patch, 'hg backout' may cause unexpected conflict, if 'hg
      backout'-ed changes are located near lines in which keywords are
      embedded, because keywords are substituted with other strings in the
      working directory.
      
      This patch suppresses keyword expansion while 'hg backout' for
      internal merge by adding 'backout' to 'restricted' command list like
      'merge'.
      5c64c338
    • Katsunori FUJIWARA's avatar
      keyword: suppress keyword expansion while 'hg graft' for internal merge · dd5ca1a3
      Katsunori FUJIWARA authored
      Before this patch, 'hg graft' may cause unexpected conflict, if 'hg
      graft'-ed changes are located near lines in which keywords are
      embedded, because keywords are substituted with other strings in the
      working directory.
      
      This patch suppresses keyword expansion while 'hg graft' for internal
      merge by adding 'graft' to 'restricted' command list like 'merge'.
      dd5ca1a3
    • Katsunori FUJIWARA's avatar
      keyword: suppress keyword expansion while 'hg rebase' for internal merge · 65dd65c6
      Katsunori FUJIWARA authored
      Before this patch, 'hg rebase' may cause unexpected conflict, if 'hg
      rebase'-ed changes are located near lines in which keywords are
      embedded, because keywords are substituted with other strings in the
      working directory.
      
      This patch suppresses keyword expansion while 'hg rebase' for internal
      merge by adding 'rebase' to 'restricted' command list like 'merge'.
      
      This patch specifies '--keep' to 'hg rebase', because revision #10 is
      useful also for tests in succeeding patches.
      65dd65c6
    • Katsunori FUJIWARA's avatar
      keyword: suppress keyword expansion while 'hg unshelve' for internal merge · 99f7e5fe
      Katsunori FUJIWARA authored
      Before this patch, 'hg unshelve' may cause unexpected conflict, if 'hg
      unshelve'-ed changes are located near lines in which keywords are
      embedded, because keywords are substituted with other strings in the
      working directory.
      
      This patch suppresses keyword expansion while 'hg unshelve' for
      internal merge by adding 'unshelve' to 'restricted' command list like
      'merge'.
      99f7e5fe
  28. May 26, 2014
    • Pierre-Yves David's avatar
      merge: drop the quotes around commit description · 9c35f3a8
      Pierre-Yves David authored
      We already have a ":" after the user name to denote the start of the
      description. The current usage of quotes around the description is
      problematic as the truncation to 80 chars is likely to drop the
      closing quote. This may confuse syntax coloration in some editors.
      9c35f3a8
  29. May 08, 2014
    • Durham Goode's avatar
      merge: add conflict marker formatter (BC) · 25d5a9ec
      Durham Goode authored
      Adds a conflict marker formatter that can produce custom conflict marker
      descriptions. It can be set via ui.mergemarkertemplate. The old behavior
      can be used still by setting ui.mergemarkers=basic.
      
      The default format is similar to:
      
        {node|short} {tag} {branch} {bookmarks} - {author}: "{desc|firstline}"
      
      And renders as:
      
        contextblahblah
        <<<<<<< local: c7fdd7ce4652 - durham: "Fix broken stuff in my feature branch"
        line from my changes
        =======
        line from the other changes
        >>>>>>> other: a3e55d7f4d38  master - sid0: "This is a commit to master th...
        morecontextblahblah
      25d5a9ec
  30. May 09, 2014
    • Matt Mackall's avatar
      resolve: simplify "finished" message · e4f451c8
      Matt Mackall authored
      The recently introduced message was:
      
        no unresolved files; you may continue your unfinished operation
      
      This had three problems:
      
      - looks a bit like an error message because it's not saying "we've
        just resolved the last file"
      - refers to "unfinished operation", which won't be the case with
        "update" or "merge"
      - introduces semicolons to error messages, which is stylistically
        questionable
      
      I've simplified this to:
      
        no more unresolved files
      
      In the future, if we want to prompt someone to continue a particular operation, we should use
      a hint style:
      
        no more unresolved files
        (use 'hg graft --continue' to finish grafting)
      e4f451c8
  31. Apr 19, 2014
    • Gregory Szorc's avatar
      resolve: print message when no unresolved files remain (issue4214) · 19d6fec6
      Gregory Szorc authored
      When using resolve, users often have to consult with the output of |hg
      resolve -l| to see if any unresolved files remain. This step is tedious
      and adds overhead to resolving.
      
      This patch will notify a user if there are no unresolved files remaining
      after executing |hg resolve|::
      
          no unresolved files; you may continue your unfinished operation
      
      The patch stops short of telling the user exactly what command should be
      executed to continue the unfinished operation. That is because this
      information is not currently captured anywhere. This would make a
      compelling follow-up feature.
      19d6fec6
Loading