[PATCH 1 of 5 stable] patch: update copying of dict keys and values to work on Python 3

Augie Fackler raf at durin42.com
Mon Jul 24 21:08:09 UTC 2017


# HG changeset patch
# User Augie Fackler <augie at google.com>
# Date 1500921775 14400
#      Mon Jul 24 14:42:55 2017 -0400
# Branch stable
# Node ID a67471f29dbb38e5ac51a9bacf4bb5fff076e1bb
# Parent  e12c3049af8ee85dfcf0575297fd568dde5cc8d2
patch: update copying of dict keys and values to work on Python 3

diff --git a/mercurial/patch.py b/mercurial/patch.py
--- a/mercurial/patch.py
+++ b/mercurial/patch.py
@@ -2569,7 +2569,7 @@ def trydiff(repo, revs, ctx1, ctx2, modi
 
     if relroot != '' and (repo.ui.configbool('devel', 'all-warnings')
                           or repo.ui.configbool('devel', 'check-relroot')):
-        for f in modified + added + removed + copy.keys() + copy.values():
+        for f in modified + added + removed + list(copy) + list(copy.values()):
             if f is not None and not f.startswith(relroot):
                 raise AssertionError(
                     "file %s doesn't start with relroot %s" % (f, relroot))


More information about the Mercurial-devel mailing list