changeset 5481:565194775c41

branching: merge with stable
author Pierre-Yves David <pierre-yves.david@octobus.net>
date Tue, 25 Aug 2020 10:12:29 +0200
parents f2d919aa64d6 (current diff) 9242d0b5f74d (diff)
children 3435822cd758
files CHANGELOG hgext3rd/evolve/rewind.py
diffstat 4 files changed, 25 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/CHANGELOG	Fri Jul 24 00:18:12 2020 +0530
+++ b/CHANGELOG	Tue Aug 25 10:12:29 2020 +0200
@@ -10,6 +10,12 @@
 
   * stack: support foo#stack relation revset (hg-5.4+ only)
 
+10.0.2 - in progress
+--------------------
+
+  * py3: use '%d' for formatting revision numbers in stable range cache warning
+    (issue6390)
+
 10.0.1 -- 2020-07-31
 --------------------
 
--- a/hgext3rd/evolve/cmdrewrite.py	Fri Jul 24 00:18:12 2020 +0530
+++ b/hgext3rd/evolve/cmdrewrite.py	Tue Aug 25 10:12:29 2020 +0200
@@ -1308,6 +1308,13 @@
                         # prompting for confirmation
                         ui.status(_(b'discarding remaining changes\n'))
                         target = newcommits[0]
+                        args = []
+                        kwargs = {}
+                        code = cmdutil.revert.__code__
+                        # hg <= 5.5 (8c466bcb0879)
+                        if r'parents' in code.co_varnames[:code.co_argcount]:
+                            args.append((target, node.nullid))
+                        assert target.node() == repo.dirstate.p1()
                         if pats:
                             status = repo.status(match=matcher)
                             dirty = set()
@@ -1315,12 +1322,10 @@
                             dirty.update(status.added)
                             dirty.update(status.removed)
                             dirty.update(status.deleted)
-                            dirty = sorted(dirty)
-                            cmdutil.revert(ui, repo, repo[target],
-                                           (target, node.nullid), *dirty)
+                            args += sorted(dirty)
                         else:
-                            cmdutil.revert(ui, repo, repo[target],
-                                           (target, node.nullid), all=True)
+                            kwargs[r'all'] = True
+                        cmdutil.revert(ui, repo, repo[target], *args, **kwargs)
                     elif nextaction == b'?':
                         nextaction = None
                         ui.write(_(b"y - yes, continue selection\n"))
--- a/hgext3rd/evolve/rewind.py	Fri Jul 24 00:18:12 2020 +0530
+++ b/hgext3rd/evolve/rewind.py	Tue Aug 25 10:12:29 2020 +0200
@@ -151,8 +151,14 @@
                     revertopts = {'no_backup': True, 'all': True,
                                   'rev': oldctx.node()}
                     with ui.configoverride({(b'ui', b'quiet'): True}):
-                        cmdutil.revert(repo.ui, repo, oldctx,
-                                       repo.dirstate.parents(), **revertopts)
+                        code = cmdutil.revert.__code__
+                        # hg <= 5.5 (8c466bcb0879)
+                        if r'parents' in code.co_varnames[:code.co_argcount]:
+                            cmdutil.revert(repo.ui, repo, oldctx,
+                                           repo.dirstate.parents(),
+                                           **revertopts)
+                        else:
+                            cmdutil.revert(repo.ui, repo, oldctx, **revertopts)
                 else:
                     hg.updaterepo(repo, update_target, False)
 
--- a/hgext3rd/evolve/stablerangecache.py	Fri Jul 24 00:18:12 2020 +0530
+++ b/hgext3rd/evolve/stablerangecache.py	Tue Aug 25 10:12:29 2020 +0200
@@ -335,7 +335,7 @@
                 # to add. This will confuse sqlite
                 msg = _(b'stable-range cache: skipping write, '
                         b'database drifted under my feet\n')
-                hint = _(b'(disk: %s-%s vs mem: %s-%s)\n')
+                hint = _(b'(disk: %s-%d vs mem: %s-%d)\n')
                 data = (nodemod.hex(meta[2]), meta[1],
                         nodemod.hex(self._ondisktipnode), self._ondisktiprev)
                 repo.ui.warn(msg)