# HG changeset patch # User Patrick Mezard # Date 1290194044 -3600 # Node ID bf1c27a89c76e151aede3d45f2c55e39d936c722 # Parent 864b5b67a5f04eb72ac7c7b81393b2f64419c4df Extract files not to be pushed in util diff --git a/hgsubversion/pushmod.py b/hgsubversion/pushmod.py --- 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 = '' diff --git a/hgsubversion/svncommands.py b/hgsubversion/svncommands.py --- 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))) diff --git a/hgsubversion/util.py b/hgsubversion/util.py --- 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)