[PATCH] commands: remove unecessary copying of list in graft()

Hannes Oldenburg hannes.christian.oldenburg at gmail.com
Mon Sep 5 05:59:00 EDT 2016


# HG changeset patch
# User Hannes Oldenburg <hannes.christian.oldenburg at gmail.com>
# Date 1473064176 0
#      Mon Sep 05 08:29:36 2016 +0000
# Node ID c072f8ecd0021e849360c8ffdcb8a5a973beb01f
# Parent  f148bfa40489269be2e48046734f81065129847a
commands: remove unecessary copying of list in graft()

diff -r f148bfa40489 -r c072f8ecd002 mercurial/commands.py
--- a/mercurial/commands.py	Tue Jul 05 09:37:07 2016 +0200
+++ b/mercurial/commands.py	Mon Sep 05 08:29:36 2016 +0000
@@ -4141,9 +4141,7 @@
         # check for ancestors of dest branch
         crev = repo['.'].rev()
         ancestors = repo.changelog.ancestors([crev], inclusive=True)
-        # Cannot use x.remove(y) on smart set, this has to be a list.
         # XXX make this lazy in the future
-        revs = list(revs)
         # don't mutate while iterating, create a copy
         for rev in list(revs):
             if rev in ancestors:


More information about the Mercurial-devel mailing list