diff push_cmd.py @ 39:b3c7b844b782

Some more fixes of cases discovered in the melange repo. If anyone knows how I can reproduce a "replaced" state in Subversion, I'd love to be able to make a real test case for this code.
author Augie Fackler <durin42@gmail.com>
date Sun, 26 Oct 2008 22:06:13 -0500
parents c5039390332f
children 85fcac4e2291
line wrap: on
line diff
--- a/push_cmd.py
+++ b/push_cmd.py
@@ -65,15 +65,6 @@ def push_revisions_to_subversion(ui, rep
                                                               svn_commit_hashes)
     return 0
 
-class PrefixMatch(object):
-    def __init__(self, prefix):
-        self.p = prefix
-    
-    def files(self):
-        return []
-    
-    def __call__(self, fn):
-        return fn.startswith(self.p)
 
 def commit_from_rev(ui, repo, rev_ctx, hg_editor, svn_url, base_revision):
     """Build and send a commit from Mercurial to Subversion.
@@ -106,7 +97,7 @@ def commit_from_rev(ui, repo, rev_ctx, h
                 action = 'add'
                 dirname = '/'.join(file.split('/')[:-1] + [''])
                 # check for new directories
-                if not list(parent.walk(PrefixMatch(dirname))):
+                if not list(parent.walk(util.PrefixMatch(dirname))):
                     # check and see if the dir exists svn-side.
                     try:
                         assert svn.list_dir('%s/%s' % (branch_path, dirname))