merge with stable
authorYuya Nishihara <yuya@tcha.org>
Mon, 14 Sep 2020 19:39:51 +0900
changeset 45458 4532e7ebde4d
parent 45457 d2b5a7659fff (current diff)
parent 45416 4ebc5f325bed (diff)
child 45459 ccd3bf4490c1
merge with stable
mercurial/logcmdutil.py
tests/test-rebase-obsolete.t
--- a/hgdemandimport/__init__.py	Sun Sep 13 17:52:24 2020 +0900
+++ b/hgdemandimport/__init__.py	Mon Sep 14 19:39:51 2020 +0900
@@ -46,6 +46,7 @@
     # setuptools' pkg_resources.py expects "from __main__ import x" to
     # raise ImportError if x not defined
     '__main__',
+    '_ast',  # https://bugs.python.org/issue41631
     '_ssl',  # conditional imports in the stdlib, issue1964
     '_sre',  # issue4920
     'rfc822',
--- a/mercurial/dagop.py	Sun Sep 13 17:52:24 2020 +0900
+++ b/mercurial/dagop.py	Mon Sep 14 19:39:51 2020 +0900
@@ -17,6 +17,7 @@
     node,
     patch,
     pycompat,
+    scmutil,
     smartset,
 )
 
@@ -90,7 +91,7 @@
     visitheap = []
 
     def addvisit(fctx):
-        rev = fctx.rev()
+        rev = scmutil.intrev(fctx)
         if rev not in visit:
             visit[rev] = set()
             heapq.heappush(visitheap, -rev)  # max heap
--- a/mercurial/logcmdutil.py	Sun Sep 13 17:52:24 2020 +0900
+++ b/mercurial/logcmdutil.py	Mon Sep 14 19:39:51 2020 +0900
@@ -753,7 +753,7 @@
     fcache = {}
 
     def filematcher(ctx):
-        return scmutil.matchfiles(repo, fcache.get(ctx.rev(), []))
+        return scmutil.matchfiles(repo, fcache.get(scmutil.intrev(ctx), []))
 
     def revgen():
         for rev, cs in dagop.filectxancestors(fctxs, followfirst=followfirst):
--- a/mercurial/repoview.py	Sun Sep 13 17:52:24 2020 +0900
+++ b/mercurial/repoview.py	Mon Sep 14 19:39:51 2020 +0900
@@ -62,6 +62,17 @@
         rev = cl.index.get_rev
         pinned.update(rev(t[0]) for t in tags.values())
         pinned.discard(None)
+
+    # Avoid cycle: mercurial.filemerge -> mercurial.templater ->
+    # mercurial.templatefuncs -> mercurial.revset -> mercurial.repoview ->
+    # mercurial.mergestate -> mercurial.filemerge
+    from . import mergestate
+
+    ms = mergestate.mergestate.read(repo)
+    if ms.active():
+        pinned.add(ms.localctx.rev())
+        pinned.add(ms.otherctx.rev())
+
     return pinned
 
 
--- a/tests/test-log.t	Sun Sep 13 17:52:24 2020 +0900
+++ b/tests/test-log.t	Mon Sep 14 19:39:51 2020 +0900
@@ -2263,6 +2263,51 @@
    }
   ]
 
+follow files from wdir
+
+  $ hg cp d1/f1 f1-copy
+  $ hg stat --all
+  M d1/f1
+  A d1/f2
+  A f1-copy
+    d1/f1
+  R .d6/f1
+  C D2/f1
+  C D3.i/f1
+  C d4.hg/f1
+  C d5.d/f1
+
+  $ hg log -T '== {rev} ==\n' -fr'wdir()' --git --stat d5.d/f1
+  == 2147483647 ==
+  
+  == 0 ==
+   d5.d/f1 |  1 +
+   1 files changed, 1 insertions(+), 0 deletions(-)
+  
+
+  $ hg log -T '== {rev} ==\n' -fr'wdir()' --git --stat d1/f1
+  == 2147483647 ==
+   d1/f1 |  1 +
+   1 files changed, 1 insertions(+), 0 deletions(-)
+  
+  == 0 ==
+   d1/f1 |  1 +
+   1 files changed, 1 insertions(+), 0 deletions(-)
+  
+
+ BROKEN: added file should exist in wdir
+  $ hg log -T '== {rev} ==\n' -fr'wdir()' --git --stat d1/f2
+  abort: cannot follow nonexistent file: "d1/f2"
+  [255]
+
+ BROKEN: copied file should exist in wdir
+  $ hg log -T '== {rev} ==\n' -fr'wdir()' --git --stat f1-copy
+  abort: cannot follow nonexistent file: "f1-copy"
+  [255]
+
+  $ hg log -T '== {rev} ==\n' -fr'wdir()' --git --stat notfound
+  notfound: $ENOENT$
+
   $ hg revert -aqC
 
 Check that adding an arbitrary name shows up in log automatically
--- a/tests/test-rebase-check-restore.t	Sun Sep 13 17:52:24 2020 +0900
+++ b/tests/test-rebase-check-restore.t	Mon Sep 14 19:39:51 2020 +0900
@@ -153,5 +153,29 @@
   |/
   o  0:draft 'A'
   
+  $ cat >> .hg/hgrc << EOF
+  > [experimental]
+  > evolution.createmarkers=True
+  > EOF
+
+When updating away from a dirty, obsolete wdir, don't complain that the old p1
+is filtered and requires --hidden.
+
+  $ echo conflict > A
+  $ hg debugobsolete 071d07019675449d53b7e312c65bcf28adbbdb64 965c486023dbfdc9c32c52dc249a231882fd5c17
+  1 new obsolescence markers
+  obsoleted 1 changesets
+  $ hg update -r 2 --config ui.merge=internal:merge --merge
+  merging A
+  warning: conflicts while merging A! (edit, then use 'hg resolve --mark')
+  1 files updated, 0 files merged, 1 files removed, 1 files unresolved
+  use 'hg resolve' to retry unresolved file merges
+  [1]
+  $ hg resolve A
+  merging A
+  warning: conflicts while merging A! (edit, then use 'hg resolve --mark')
+  [1]
+
+  $ hg up -C -q .
 
   $ cd ..
--- a/tests/test-rebase-obsolete.t	Sun Sep 13 17:52:24 2020 +0900
+++ b/tests/test-rebase-obsolete.t	Mon Sep 14 19:39:51 2020 +0900
@@ -1795,6 +1795,8 @@
   $ hg log -G
   @  2:b18e25de2cf5 D
   |
+  | %  1:2ec65233581b B (pruned using prune)
+  |/
   o  0:426bada5c675 A
   
   $ hg summary
@@ -1802,8 +1804,8 @@
    D
   branch: default
   commit: 1 modified, 1 added, 1 unknown, 1 unresolved
-  update: (current)
-  phases: 2 draft
+  update: 1 new changesets, 2 branch heads (merge)
+  phases: 3 draft
   rebase: 0 rebased, 2 remaining (rebase --continue)
 
   $ hg rebase --abort