summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Maw <richard.maw@codethink.co.uk>2012-01-13 14:50:23 +0000
committerLorry <lorry@roadtrain.codethink.co.uk>2012-01-13 14:50:47 +0000
commitc3605e3f6b314a98e0647644760e21d5087ad51c (patch)
tree25c7e5aca3f79e1b9f4f27be9ffc5cf81f53a9ca
parent9e1c8a6ef0e18f2e6dd4847aa0e66b59341fe0ef (diff)
downloadlorry-c3605e3f6b314a98e0647644760e21d5087ad51c.tar.gz
lorry bzr import: add marks files
adds the marks files when converting, I don't know what they are all for This also fixes lorry importing bzr repos
-rwxr-xr-xlorry26
1 files changed, 16 insertions, 10 deletions
diff --git a/lorry b/lorry
index b8c115a..b81c832 100755
--- a/lorry
+++ b/lorry
@@ -115,25 +115,31 @@ class Lorry(cliapp.Application):
cwd=branchdir)
exports = {}
+ bzrmarks = os.path.join(dirname, 'marks.bzr')
for branch, address in branches.iteritems():
branchdir = os.path.join(bzrdir, branch)
- self.progress('.. fast-exporting from bzr')
+ self.progress('.. fast-exporting branch %s from bzr' % branch)
exports[branch] = os.path.join(dirname, 'fast-export' + branch)
- self.run_program(['bzr', 'fast-export', '--quiet',
- '--git-branch=' + branch, branchdir,
- exports[branch]])
+ cmdline = ['bzr', 'fast-export', '--git-branch=' + branch, branchdir, exports[branch]]
+ if os.path.exists(bzrmarks):
+ cmdline.append('--marks=' + bzrmarks)
+ else:
+ cmdline.append('--export-marks=' + bzrmarks)
+ self.run_program(cmdline)
+ gitmarks = os.path.join(dirname, 'marks.git')
for branch, address in branches.iteritems():
- branchdir = os.path.join(bzrdir, branch)
- self.progress('.. fast-importing into git')
- # redirect stdin with this rather than shell command, more safe
+ self.progress('.. fast-importing branch %s into git' % branch)
with open(exports[branch], 'rb') as exportfile:
- self.run_program(['git', 'fast-import'], stdin=exportfile,
- cwd=branchdir)
+ cmdline = ['git', 'fast-import', '--export-marks=' + gitmarks]
+ if os.path.exists(gitmarks):
+ cmdline.append('--import-marks=' + gitmarks)
+ self.run_program(cmdline, stdin=exportfile,
+ cwd=gitdir)
for branch, address in branches.iteritems():
branchdir = os.path.join(bzrdir, branch)
- self.progress('.. removing temporary fast-export file')
+ self.progress('.. removing temporary fast-export file ' + exports[branch])
os.remove(exports[branch])
def gitify_svn(self, dirname, gitdir, spec):