comparison hgext/convert/bzr.py @ 38572:85da230c316a

convert: add a config knob for not saving the bzr revision Now that the timestamp is fixed, the log of the Mercurial repo is still unstable with --debug, because the bzr commit ID keeps changing. Both hg and git implement `convert.*.saverev`, so do the same here.
author Matt Harbison <matt_harbison@yahoo.com>
date Thu, 05 Jul 2018 15:07:29 -0400
parents 670eb4fa1b86
children 2372284d9457
comparison
equal deleted inserted replaced
38571:30a027c0e327 38572:85da230c316a
63 self.sourcerepo = bzrdir.BzrDir.open(path).open_repository() 63 self.sourcerepo = bzrdir.BzrDir.open(path).open_repository()
64 except errors.NoRepositoryPresent: 64 except errors.NoRepositoryPresent:
65 raise common.NoRepo(_('%s does not look like a Bazaar repository') 65 raise common.NoRepo(_('%s does not look like a Bazaar repository')
66 % path) 66 % path)
67 self._parentids = {} 67 self._parentids = {}
68 self._saverev = ui.configbool('convert', 'bzr.saverev')
68 69
69 def _checkrepotype(self, path): 70 def _checkrepotype(self, path):
70 # Lightweight checkouts detection is informational but probably 71 # Lightweight checkouts detection is informational but probably
71 # fragile at API level. It should not terminate the conversion. 72 # fragile at API level. It should not terminate the conversion.
72 try: 73 try:
173 return common.commit(parents=parents, 174 return common.commit(parents=parents,
174 date='%d %d' % (rev.timestamp, -rev.timezone), 175 date='%d %d' % (rev.timestamp, -rev.timezone),
175 author=self.recode(rev.committer), 176 author=self.recode(rev.committer),
176 desc=self.recode(rev.message), 177 desc=self.recode(rev.message),
177 branch=branch, 178 branch=branch,
178 rev=version) 179 rev=version,
180 saverev=self._saverev)
179 181
180 def gettags(self): 182 def gettags(self):
181 bytetags = {} 183 bytetags = {}
182 for branch in self._bzrbranches(): 184 for branch in self._bzrbranches():
183 if not branch.supports_tags(): 185 if not branch.supports_tags():