changeset 760:bf1c27a89c76

Extract files not to be pushed in util
author Patrick Mezard <pmezard@gmail.com>
date Fri, 19 Nov 2010 20:14:04 +0100
parents 864b5b67a5f0
children 979148947967
files hgsubversion/pushmod.py hgsubversion/svncommands.py hgsubversion/util.py
diffstat 3 files changed, 5 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/hgsubversion/pushmod.py
+++ b/hgsubversion/pushmod.py
@@ -2,7 +2,7 @@ from mercurial import util as hgutil
 
 import svnwrap
 import svnexternals
-
+import util
 
 class NoFilesException(Exception):
     """Exception raised when you try and commit without files.
@@ -106,9 +106,7 @@ def commit(ui, repo, rev_ctx, meta, base
     props = {}
     copies = {}
     for file in rev_ctx.files():
-        if file in ('.hgsvnexternals',
-                    '.hgtags',
-                    ):
+        if file in util.ignoredfiles:
             continue
         new_data = base_data = ''
         action = ''
--- a/hgsubversion/svncommands.py
+++ b/hgsubversion/svncommands.py
@@ -64,9 +64,7 @@ def verify(ui, repo, *args, **opts):
             ui.write('difference in file %s\n' % fn)
             result = 1
 
-    hgfiles = set(ctx)
-    hgfiles.discard('.hgtags')
-    hgfiles.discard('.hgsvnexternals')
+    hgfiles = set(ctx) - util.ignoredfiles
     if hgfiles != svnfiles:
         missing = set(hgfiles).symmetric_difference(svnfiles)
         ui.write('missing files: %s\n' % (', '.join(missing)))
--- a/hgsubversion/util.py
+++ b/hgsubversion/util.py
@@ -13,6 +13,8 @@ try:
 except ImportError:
     pass
 
+ignoredfiles = set(['.hgtags', '.hgsvnexternals'])
+
 b_re = re.compile(r'^\+\+\+ b\/([^\n]*)', re.MULTILINE)
 a_re = re.compile(r'^--- a\/([^\n]*)', re.MULTILINE)
 devnull_re = re.compile(r'^([-+]{3}) /dev/null', re.MULTILINE)