convert: add config option to turn off use of branch names
authorBryan O'Sullivan <bos@serpentine.com>
Tue, 31 Jul 2007 17:18:59 -0700
changeset 5038 8f157190075e
parent 5037 b2607267236d
child 5039 c87de77a7d9f
convert: add config option to turn off use of branch names
hgext/convert/hg.py
--- a/hgext/convert/hg.py	Tue Jul 31 16:28:05 2007 -0700
+++ b/hgext/convert/hg.py	Tue Jul 31 17:18:59 2007 -0700
@@ -24,6 +24,7 @@
             raise NoRepo("could not open hg repo %s as sink" % path)
         self.lock = None
         self.wlock = None
+        self.branchnames = ui.configbool('convert', 'hg.usebranchnames', True)
 
     def before(self):
         self.lock = self.repo.lock()
@@ -76,7 +77,7 @@
 
         text = commit.desc
         extra = {}
-        if commit.branch:
+        if self.branchnames and commit.branch:
             extra['branch'] = commit.branch
         if commit.rev:
             extra['convert_revision'] = commit.rev