merge with stable
authorAugie Fackler <augie@google.com>
Thu, 05 Dec 2019 11:15:19 -0500
changeset 43793 29adf0a087a1
parent 43790 765a9c299c44 (current diff)
parent 43792 743c69b39332 (diff)
child 43794 d3f7bdc905fb
merge with stable
hgext/githelp.py
hgext/histedit.py
mercurial/hgweb/common.py
mercurial/hgweb/hgwebdir_mod.py
mercurial/hgweb/webutil.py
mercurial/logcmdutil.py
mercurial/pvec.py
mercurial/repair.py
mercurial/scmwindows.py
tests/test-log-linerange.t
--- a/.hgsigs	Tue Dec 03 17:17:57 2019 -0800
+++ b/.hgsigs	Thu Dec 05 11:15:19 2019 -0500
@@ -187,3 +187,4 @@
 181e52f2b62f4768aa0d988936c929dc7c4a41a0 0 iQJEBAABCAAuFiEEK8zhT1xnJaouqK63ucncgkqlvdUFAl2UzlMQHHJhZkBkdXJpbjQyLmNvbQAKCRC5ydyCSqW91SDzD/0YZqtN+LK5AusJjWaTa61DRIPhJQoZD+HKg4kAzjL8zw8SxBGLxMZkGmve9QFMNzqIr5kkPk6yEKrEWYqyPtpwrv5Xh5D4d8AKfphdzwSr+BvMk4fBEvwnBhrUJtKDEiuYQdbh4+OQfQs1c3xhtinjXn30160uzFvLQY6/h4hxai2XWj4trgoNXqPHDHlQKc6kRfPpmNO2UZhG+2Xfsava2JpcP4xA2R0XkI10be5MDoGU4AFCMUcXZzIto0DYT+HOezowoNpdC1EWVHfa+bdrlzHHO7WPaTLzEPy44/IhXmNhbwFKOk5RZ/qBADQvs9BDfmIDczOoZKTC5+ESZM0PR2np5t7+JFMUeeRcINqBdSc4Aszw3iHjgNbJJ3viU72JZvGGGd9MglP590tA0proVGxQgvXDq3mtq3Se5yOLAjmRnktW5Tnt8/Z3ycuZz+QsTEMXR5uIZvgz63ibfsCGTXFYUz9h7McGgmhfKWvQw9+MH6kRbE9U8qaUumgf4zi4HNzmf8AyaMJo07DIMwWVgjlVUdWUlN/Eg61fU3wC79mV8mLVsi5/TZ986obz4csoYSYXyyez5ScRji+znSw8v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i0MQm/jOG++AvUPM7AdVc9Y2eRFOIIBIY0nkU5LL4yVVdqoc8kgwz14xhJXGTpMDRD54F6WrQtxhbHcb+JF7QDe3i9wI1LvurW4IIA5e4DC1q9yKKxNx9cDUOMF5q9ehiW9V120LTXJnYOUwfB7D4bIhe2mpOw8yYABU3gZ0Q6iVBTH+9rZYZ9TETX6vkf/DnJXteo39OhKrZ1Z4Gj6MSAjPJLARnYGnRMgvsyHSbV0TsGA4tdEaBs3dZmUV7maxLbs70sO6r9WwUY37TcYYHGdRplD9AreDLcxvjXA73Iluoy9WBGxRWF8wftQjaE9XR4KkDFrAoqqYZwN2AwHiTjVD1lQx+xvxZeEQ3ZBDprH3Uy6TwqUo5jbvHgR2+HqaZlTg==
--- a/.hgtags	Tue Dec 03 17:17:57 2019 -0800
+++ b/.hgtags	Thu Dec 05 11:15:19 2019 -0500
@@ -200,3 +200,4 @@
 181e52f2b62f4768aa0d988936c929dc7c4a41a0 5.1.2
 59338f9561099de77c684c00f76507f11e46ebe8 5.2rc0
 ca3dca416f8d5863ca6f5a4a6a6bb835dcd5feeb 5.2
+a50fecefa691c9b72a99e49aa6fe9dd13943c2bf 5.2.1
--- a/hgext/githelp.py	Tue Dec 03 17:17:57 2019 -0800
+++ b/hgext/githelp.py	Thu Dec 05 11:15:19 2019 -0500
@@ -115,7 +115,7 @@
     args = list([convert(x) for x in args])
     opts = dict(
         [
-            (k, convert(v)) if isinstance(v, str) else (k, v)
+            (k, convert(v)) if isinstance(v, bytes) else (k, v)
             for k, v in pycompat.iteritems(opts)
         ]
     )
--- a/hgext/histedit.py	Tue Dec 03 17:17:57 2019 -0800
+++ b/hgext/histedit.py	Thu Dec 05 11:15:19 2019 -0500
@@ -2603,7 +2603,7 @@
 
 
 def stripwrapper(orig, ui, repo, nodelist, *args, **kwargs):
-    if isinstance(nodelist, str):
+    if isinstance(nodelist, bytes):
         nodelist = [nodelist]
     state = histeditstate(repo)
     if state.inprogress():
--- a/hgext/win32mbcs.py	Tue Dec 03 17:17:57 2019 -0800
+++ b/hgext/win32mbcs.py	Thu Dec 05 11:15:19 2019 -0500
@@ -77,7 +77,7 @@
 
 
 def decode(arg):
-    if isinstance(arg, str):
+    if isinstance(arg, bytes):
         uarg = arg.decode(_encoding)
         if arg == uarg.encode(_encoding):
             return uarg
--- a/mercurial/hgweb/common.py	Tue Dec 03 17:17:57 2019 -0800
+++ b/mercurial/hgweb/common.py	Thu Dec 05 11:15:19 2019 -0500
@@ -191,7 +191,7 @@
         return
 
     fpath = os.path.join(*fname.split(b'/'))
-    if isinstance(directory, str):
+    if isinstance(directory, bytes):
         directory = [directory]
     for d in directory:
         path = os.path.join(d, fpath)
--- a/mercurial/hgweb/hgwebdir_mod.py	Tue Dec 03 17:17:57 2019 -0800
+++ b/mercurial/hgweb/hgwebdir_mod.py	Thu Dec 05 11:15:19 2019 -0500
@@ -413,7 +413,7 @@
                 static = self.ui.config(b"web", b"static", untrusted=False)
                 if not static:
                     tp = self.templatepath or templater.templatepaths()
-                    if isinstance(tp, str):
+                    if isinstance(tp, bytes):
                         tp = [tp]
                     static = [os.path.join(p, b'static') for p in tp]
 
--- a/mercurial/hgweb/webcommands.py	Tue Dec 03 17:17:57 2019 -0800
+++ b/mercurial/hgweb/webcommands.py	Thu Dec 05 11:15:19 2019 -0500
@@ -1321,7 +1321,7 @@
     static = web.config(b"web", b"static", untrusted=False)
     if not static:
         tp = web.templatepath or templater.templatepaths()
-        if isinstance(tp, str):
+        if isinstance(tp, bytes):
             tp = [tp]
         static = [os.path.join(p, b'static') for p in tp]
 
--- a/mercurial/hgweb/webutil.py	Tue Dec 03 17:17:57 2019 -0800
+++ b/mercurial/hgweb/webutil.py	Thu Dec 05 11:15:19 2019 -0500
@@ -873,7 +873,7 @@
         raise error.ParseError(_(b'not displayable without template'))
 
     def show(self, context, mapping):
-        return self.join(context, b'')
+        return self.join(context, mapping, b'')
 
     def tobool(self, context, mapping):
         return bool(self._vars)
--- a/mercurial/logcmdutil.py	Tue Dec 03 17:17:57 2019 -0800
+++ b/mercurial/logcmdutil.py	Thu Dec 05 11:15:19 2019 -0500
@@ -945,6 +945,8 @@
         fctx = wctx.filectx(fname)
         for fctx, linerange in dagop.blockancestors(fctx, fromline, toline):
             rev = fctx.introrev()
+            if rev is None:
+                rev = wdirrev
             if rev not in userrevs:
                 continue
             linerangesbyrev.setdefault(rev, {}).setdefault(
@@ -955,7 +957,7 @@
         return hunks
 
     def hunksfilter(ctx):
-        fctxlineranges = linerangesbyrev.get(ctx.rev())
+        fctxlineranges = linerangesbyrev.get(scmutil.intrev(ctx))
         if fctxlineranges is None:
             return nofilterhunksfn
 
@@ -975,7 +977,7 @@
         return filterfn
 
     def filematcher(ctx):
-        files = list(linerangesbyrev.get(ctx.rev(), []))
+        files = list(linerangesbyrev.get(scmutil.intrev(ctx), []))
         return scmutil.matchfiles(repo, files)
 
     revs = sorted(linerangesbyrev, reverse=True)
--- a/mercurial/pvec.py	Tue Dec 03 17:17:57 2019 -0800
+++ b/mercurial/pvec.py	Thu Dec 05 11:15:19 2019 -0500
@@ -183,7 +183,7 @@
 
 class pvec(object):
     def __init__(self, hashorctx):
-        if isinstance(hashorctx, str):
+        if isinstance(hashorctx, bytes):
             self._bs = hashorctx
             self._depth, self._vec = _split(util.b85decode(hashorctx))
         else:
--- a/mercurial/repair.py	Tue Dec 03 17:17:57 2019 -0800
+++ b/mercurial/repair.py	Thu Dec 05 11:15:19 2019 -0500
@@ -131,7 +131,7 @@
     cl = repo.changelog
 
     # TODO handle undo of merge sets
-    if isinstance(nodelist, str):
+    if isinstance(nodelist, bytes):
         nodelist = [nodelist]
     striplist = [cl.rev(node) for node in nodelist]
     striprev = min(striplist)
--- a/mercurial/scmwindows.py	Tue Dec 03 17:17:57 2019 -0800
+++ b/mercurial/scmwindows.py	Thu Dec 05 11:15:19 2019 -0500
@@ -38,7 +38,7 @@
     value = util.lookupreg(
         b'SOFTWARE\\Mercurial', None, winreg.HKEY_LOCAL_MACHINE
     )
-    if not isinstance(value, str) or not value:
+    if not isinstance(value, bytes) or not value:
         return rcpath
     value = util.localpath(value)
     for p in value.split(pycompat.ospathsep):
--- a/tests/test-githelp.t	Tue Dec 03 17:17:57 2019 -0800
+++ b/tests/test-githelp.t	Thu Dec 05 11:15:19 2019 -0500
@@ -264,6 +264,10 @@
   $ hg githelp -- git commit --reuse-message deadbeef
   hg commit -M deadbeef
 
+githelp for reuse message using HEAD
+  $ hg githelp -- git commit --reuse-message HEAD~
+  hg commit -M .~1
+
 githelp for apply with no options
   $ hg githelp -- apply
   hg import --no-commit
--- a/tests/test-log-linerange.t	Tue Dec 03 17:17:57 2019 -0800
+++ b/tests/test-log-linerange.t	Thu Dec 05 11:15:19 2019 -0500
@@ -868,6 +868,131 @@
   +4
   
 
+Uncommitted changes with a rename
+
+  $ hg mv baz bazn
+  $ hg log -f -L bazn,5:7
+  changeset:   9:6af29c3a778f
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     foo -> dir/baz; 1-1+
+  
+  changeset:   5:cfdf972b3971
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     foo: 3 -> 3+ and 11+ -> 11-; bar: a -> a+
+  
+  changeset:   4:eaec41c1a0c9
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     11 -> 11+; leading space before "1"
+  
+  changeset:   2:63a884426fd0
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     2 -> 2+; added bar
+  
+  changeset:   0:5ae1f82b9a00
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     init
+  
+
+Uncommitted changes in requested line range
+
+  $ sed 's/2/  /' bazn > bazn.new
+  $ mv bazn.new bazn
+  $ hg diff
+  diff --git a/dir/baz b/dir/bazn
+  rename from dir/baz
+  rename to dir/bazn
+  --- a/dir/baz
+  +++ b/dir/bazn
+  @@ -3,7 +3,7 @@
+   0
+   0
+    1+
+  -2+
+  +  +
+   3+
+   4
+   5
+  $ hg log -f -L bazn,5:7
+  changeset:   9:6af29c3a778f
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     foo -> dir/baz; 1-1+
+  
+  changeset:   5:cfdf972b3971
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     foo: 3 -> 3+ and 11+ -> 11-; bar: a -> a+
+  
+  changeset:   4:eaec41c1a0c9
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     11 -> 11+; leading space before "1"
+  
+  changeset:   2:63a884426fd0
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     2 -> 2+; added bar
+  
+  changeset:   0:5ae1f82b9a00
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     init
+  
+
+Uncommitted changes in line-range + wdir()
+
+  $ hg log -r 'wdir()' -f -L bazn,5:7 --limit 2 -p
+  changeset:   2147483647:ffffffffffff
+  parent:      9:6af29c3a778f
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  
+  diff --git a/dir/baz b/dir/bazn
+  copy from dir/baz
+  copy to dir/bazn
+  --- a/dir/baz
+  +++ b/dir/bazn
+  @@ -3,7 +3,7 @@
+   0
+   0
+    1+
+  -2+
+  +  +
+   3+
+   4
+   5
+  
+  changeset:   9:6af29c3a778f
+  tag:         tip
+  user:        test
+  date:        Thu Jan 01 00:00:00 1970 +0000
+  summary:     foo -> dir/baz; 1-1+
+  
+  diff --git a/foo b/dir/baz
+  copy from foo
+  copy to dir/baz
+  --- a/foo
+  +++ b/dir/baz
+  @@ -2,7 +2,7 @@
+   0
+   0
+   0
+  - 1
+  + 1+
+   2+
+   3+
+   4
+  
+
+  $ hg revert -a -C -q
+
 Copies.
 
   $ hg copy baz bbaz
--- a/tests/test-merge-tools.t	Tue Dec 03 17:17:57 2019 -0800
+++ b/tests/test-merge-tools.t	Thu Dec 05 11:15:19 2019 -0500
@@ -72,7 +72,7 @@
 override $PATH to ensure hgmerge not visible; use $PYTHON in case we're
 running from a devel copy, not a temp installation
 
-  $ PATH="$BINDIR:/usr/sbin" "$PYTHON" "$BINDIR"/hg merge -r 2
+  $ PATH="/usr/sbin" "$PYTHON" "$BINDIR"/hg merge -r 2
   merging f
   warning: conflicts while merging f! (edit, then use 'hg resolve --mark')
   0 files updated, 0 files merged, 0 files removed, 1 files unresolved
@@ -121,7 +121,7 @@
 
   $ echo "echo fail" > false
   $ hg up -qC 1
-  $ PATH="`pwd`:$BINDIR:/usr/sbin" "$PYTHON" "$BINDIR"/hg merge -r 2
+  $ PATH="`pwd`:/usr/sbin" "$PYTHON" "$BINDIR"/hg merge -r 2
   merging f
   warning: conflicts while merging f! (edit, then use 'hg resolve --mark')
   0 files updated, 0 files merged, 0 files removed, 1 files unresolved
@@ -135,7 +135,7 @@
 
   $ mkdir false
   $ hg up -qC 1
-  $ PATH="`pwd`:$BINDIR:/usr/sbin" "$PYTHON" "$BINDIR"/hg merge -r 2
+  $ PATH="`pwd`:/usr/sbin" "$PYTHON" "$BINDIR"/hg merge -r 2
   merging f
   warning: conflicts while merging f! (edit, then use 'hg resolve --mark')
   0 files updated, 0 files merged, 0 files removed, 1 files unresolved