Mercurial > public > mercurial-scm > hg
diff hgext/convert/hg.py @ 5554:2147a734dcf9
convert: tell the source repository when a rev has been converted
This lets us roundtrip changes between svn and hg.
author | Bryan O'Sullivan <bos@serpentine.com> |
---|---|
date | Mon, 26 Nov 2007 17:23:20 -0800 |
parents | ee80591f5636 |
children | 61fdf2558c0a |
line wrap: on
line diff
--- a/hgext/convert/hg.py Mon Nov 26 14:01:31 2007 -0800 +++ b/hgext/convert/hg.py Mon Nov 26 17:23:20 2007 -0800 @@ -24,8 +24,6 @@ if os.path.isdir(path) and len(os.listdir(path)) > 0: try: self.repo = hg.repository(self.ui, path) - ui.status(_('destination %s is a Mercurial repository\n') % - path) except hg.RepoError, err: ui.print_exc() raise NoRepo(err.args[0]) @@ -195,6 +193,7 @@ self.lastrev = None self.lastctx = None self._changescache = None + self.convertfp = None def changectx(self, rev): if self.lastrev != rev: @@ -258,3 +257,9 @@ return changes[0] + changes[1] + changes[2] + def converted(self, rev, destrev): + if self.convertfp is None: + self.convertfp = open(os.path.join(self.path, '.hg', 'shamap'), + 'a') + self.convertfp.write('%s %s\n' % (destrev, rev)) + self.convertfp.flush()