diff hgsubversion/util.py @ 497:cad864ed29de

util: make aresamefiles take one file and just be issamefile instead.
author Augie Fackler <durin42@gmail.com>
date Fri, 16 Oct 2009 19:09:53 -0400
parents 15443c592f7a
children ac9c9e1a8022
line wrap: on
line diff
--- a/hgsubversion/util.py
+++ b/hgsubversion/util.py
@@ -121,10 +121,8 @@ def swap_out_encoding(new_encoding="UTF-
     return old
 
 
-def aresamefiles(parentctx, childctx, files):
-    """Assuming all files exist in childctx and parentctx, return True
-    if none of them was changed in-between.
-    """
+def issamefile(parentctx, childctx, f):
+    """Assuming f exists and is the same in childctx and parentctx, return True."""
     if parentctx == childctx:
         return True
     if parentctx.rev() > childctx.rev():
@@ -135,12 +133,10 @@ def aresamefiles(parentctx, childctx, fi
         for ctx in selfctx.ancestors():
             yield ctx
 
-    files = dict.fromkeys(files)
     for pctx in selfandancestors(childctx):
         if pctx.rev() <= parentctx.rev():
             return True
-        for f in pctx.files():
-            if f in files:
-                return False
+        if f in pctx.files():
+            return False
     # parentctx is not an ancestor of childctx, files are unrelated
     return False