[PATCH] transplant: remove unneeded loop over repo in revset

Idan Kamara idankk86 at gmail.com
Fri May 6 08:01:26 CDT 2011


# HG changeset patch
# User Idan Kamara <idankk86 at gmail.com>
# Date 1304686848 -10800
# Node ID 3da127526bdb84e2b878a742ceb774ac63b25c9c
# Parent  8fefde26b84958169dfb63051a3d170b5332a950
transplant: remove unneeded loop over repo in revset

diff -r 8fefde26b849 -r 3da127526bdb hgext/transplant.py
--- a/hgext/transplant.py	Fri May 06 15:37:38 2011 +0300
+++ b/hgext/transplant.py	Fri May 06 16:00:48 2011 +0300
@@ -602,11 +602,7 @@
       s = revset.getset(repo, subset, x)
     else:
       s = subset
-    cs = set()
-    for r in xrange(0, len(repo)):
-      if repo[r].extra().get('transplant_source'):
-        cs.add(r)
-    return [r for r in s if r in cs]
+    return [r for r in s if repo[r].extra().get('transplant_source')]
 
 def kwtransplanted(repo, ctx, **args):
     """:transplanted: String. The node identifier of the transplanted


More information about the Mercurial-devel mailing list