diff --git a/.hgsigs b/.hgsigs --- a/.hgsigs +++ b/.hgsigs @@ -187,3 +187,4 @@ a4e32fd539ab41489a51b2aa88bda9a73b839562 181e52f2b62f4768aa0d988936c929dc7c4a41a0 0 iQJEBAABCAAuFiEEK8zhT1xnJaouqK63ucncgkqlvdUFAl2UzlMQHHJhZkBkdXJpbjQyLmNvbQAKCRC5ydyCSqW91SDzD/0YZqtN+LK5AusJjWaTa61DRIPhJQoZD+HKg4kAzjL8zw8SxBGLxMZkGmve9QFMNzqIr5kkPk6yEKrEWYqyPtpwrv5Xh5D4d8AKfphdzwSr+BvMk4fBEvwnBhrUJtKDEiuYQdbh4+OQfQs1c3xhtinjXn30160uzFvLQY6/h4hxai2XWj4trgoNXqPHDHlQKc6kRfPpmNO2UZhG+2Xfsava2JpcP4xA2R0XkI10be5MDoGU4AFCMUcXZzIto0DYT+HOezowoNpdC1EWVHfa+bdrlzHHO7WPaTLzEPy44/IhXmNhbwFKOk5RZ/qBADQvs9BDfmIDczOoZKTC5+ESZM0PR2np5t7+JFMUeeRcINqBdSc4Aszw3iHjgNbJJ3viU72JZvGGGd9MglP590tA0proVGxQgvXDq3mtq3Se5yOLAjmRnktW5Tnt8/Z3ycuZz+QsTEMXR5uIZvgz63ibfsCGTXFYUz9h7McGgmhfKWvQw9+MH6kRbE9U8qaUumgf4zi4HNzmf8AyaMJo07DIMwWVgjlVUdWUlN/Eg61fU3wC79mV8mLVsi5/TZ986obz4csoYSYXyyez5ScRji+znSw8vUx0YhoiOQbDms/y2QZR/toyon554tHkDZsya2lhpwXs8T0IFZhERXsmz/XmT3fWnhSzyrUe6VjBMep1zn6lvQ== 59338f9561099de77c684c00f76507f11e46ebe8 0 iQJEBAABCAAuFiEEK8zhT1xnJaouqK63ucncgkqlvdUFAl2ty1MQHHJhZkBkdXJpbjQyLmNvbQAKCRC5ydyCSqW91XBUD/wJqwW0cuMCUvuUODLIfWa7ZxNl1mV9eW3tFQEuLGry97s12KDwBe0Erdjj7DASl4/6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wUY37TcYYHGdRplD9AreDLcxvjXA73Iluoy9WBGxRWF8wftQjaE9XR4KkDFrAoqqYZwN2AwHiTjVD1lQx+xvxZeEQ3ZBDprH3Uy6TwqUo5jbvHgR2+HqaZlTg== diff --git a/.hgtags b/.hgtags --- a/.hgtags +++ b/.hgtags @@ -200,3 +200,4 @@ a4e32fd539ab41489a51b2aa88bda9a73b839562 181e52f2b62f4768aa0d988936c929dc7c4a41a0 5.1.2 59338f9561099de77c684c00f76507f11e46ebe8 5.2rc0 ca3dca416f8d5863ca6f5a4a6a6bb835dcd5feeb 5.2 +a50fecefa691c9b72a99e49aa6fe9dd13943c2bf 5.2.1 diff --git a/hgext/githelp.py b/hgext/githelp.py --- a/hgext/githelp.py +++ b/hgext/githelp.py @@ -115,7 +115,7 @@ def parseoptions(ui, cmdoptions, args): 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) ] ) diff --git a/hgext/histedit.py b/hgext/histedit.py --- a/hgext/histedit.py +++ b/hgext/histedit.py @@ -2603,7 +2603,7 @@ def cleanupnode(ui, repo, nodes, nobacku def stripwrapper(orig, ui, repo, nodelist, *args, **kwargs): - if isinstance(nodelist, str): + if isinstance(nodelist, bytes): nodelist = [nodelist] state = histeditstate(repo) if state.inprogress(): diff --git a/hgext/win32mbcs.py b/hgext/win32mbcs.py --- a/hgext/win32mbcs.py +++ b/hgext/win32mbcs.py @@ -77,7 +77,7 @@ configitem( def decode(arg): - if isinstance(arg, str): + if isinstance(arg, bytes): uarg = arg.decode(_encoding) if arg == uarg.encode(_encoding): return uarg diff --git a/mercurial/hgweb/common.py b/mercurial/hgweb/common.py --- a/mercurial/hgweb/common.py +++ b/mercurial/hgweb/common.py @@ -191,7 +191,7 @@ def staticfile(directory, fname, res): 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) diff --git a/mercurial/hgweb/hgwebdir_mod.py b/mercurial/hgweb/hgwebdir_mod.py --- a/mercurial/hgweb/hgwebdir_mod.py +++ b/mercurial/hgweb/hgwebdir_mod.py @@ -413,7 +413,7 @@ class hgwebdir(object): 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] diff --git a/mercurial/hgweb/webcommands.py b/mercurial/hgweb/webcommands.py --- a/mercurial/hgweb/webcommands.py +++ b/mercurial/hgweb/webcommands.py @@ -1321,7 +1321,7 @@ def static(web): 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] diff --git a/mercurial/hgweb/webutil.py b/mercurial/hgweb/webutil.py --- a/mercurial/hgweb/webutil.py +++ b/mercurial/hgweb/webutil.py @@ -873,7 +873,7 @@ class sessionvars(templateutil.wrapped): 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) diff --git a/mercurial/logcmdutil.py b/mercurial/logcmdutil.py --- a/mercurial/logcmdutil.py +++ b/mercurial/logcmdutil.py @@ -945,6 +945,8 @@ def getlinerangerevs(repo, userrevs, opt 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 @@ def getlinerangerevs(repo, userrevs, opt 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 @@ def getlinerangerevs(repo, userrevs, opt 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) diff --git a/mercurial/pvec.py b/mercurial/pvec.py --- a/mercurial/pvec.py +++ b/mercurial/pvec.py @@ -183,7 +183,7 @@ def ctxpvec(ctx): 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: diff --git a/mercurial/repair.py b/mercurial/repair.py --- a/mercurial/repair.py +++ b/mercurial/repair.py @@ -131,7 +131,7 @@ def strip(ui, repo, nodelist, backup=Tru 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) diff --git a/mercurial/scmwindows.py b/mercurial/scmwindows.py --- a/mercurial/scmwindows.py +++ b/mercurial/scmwindows.py @@ -38,7 +38,7 @@ def systemrcpath(): 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): diff --git a/tests/test-githelp.t b/tests/test-githelp.t --- a/tests/test-githelp.t +++ b/tests/test-githelp.t @@ -264,6 +264,10 @@ githelp for reuse message using the the $ 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 diff --git a/tests/test-log-linerange.t b/tests/test-log-linerange.t --- a/tests/test-log-linerange.t +++ b/tests/test-log-linerange.t @@ -868,6 +868,131 @@ Renames are followed. +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 diff --git a/tests/test-merge-tools.t b/tests/test-merge-tools.t --- a/tests/test-merge-tools.t +++ b/tests/test-merge-tools.t @@ -72,7 +72,7 @@ hg merge -r 2 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 @@ unexecutable file in $PATH shouldn't be $ 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 @@ executable directory in $PATH shouldn't $ 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