From patchwork Mon Sep 5 09:59:00 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: commands: remove unecessary copying of list in graft() From: Hannes Oldenburg X-Patchwork-Id: 16548 Message-Id: To: mercurial-devel@mercurial-scm.org Date: Mon, 05 Sep 2016 09:59:00 +0000 # HG changeset patch # User Hannes Oldenburg # 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: