Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
Improved output for multi branch imports and noted another little todo item
author
Simon Hausmann
<shausman@trolltech.com>
Sun, 20 May 2007 22:39:16 +0000
(
00:39
+0200)
committer
Simon Hausmann
<shausman@trolltech.com>
Sun, 20 May 2007 22:39:16 +0000
(
00:39
+0200)
Signed-off-by: Simon Hausmann <shausman@trolltech.com>
contrib/fast-import/git-p4
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
b1561ee
)
diff --git
a/contrib/fast-import/git-p4
b/contrib/fast-import/git-p4
index 5055f3214039666f926cb2f3e3b9324f01fb8c2f..beb6529b44dcd91ac96929a46afc61e5058a90aa 100755
(executable)
--- a/
contrib/fast-import/git-p4
+++ b/
contrib/fast-import/git-p4
@@
-16,6
+16,8
@@
# it's possible to recover if anything goes wrong instead of potentially
# loosing a change entirely because it was never comitted to git and
# the p4 submit failed (or resulted in lots of conflicts, etc.)
# it's possible to recover if anything goes wrong instead of potentially
# loosing a change entirely because it was never comitted to git and
# the p4 submit failed (or resulted in lots of conflicts, etc.)
+# * Consider making --with-origin the default, assuming that the git
+# protocol is always more efficient. (needs manual testing first :)
#
import optparse, sys, os, marshal, popen2, subprocess, shelve
#
import optparse, sys, os, marshal, popen2, subprocess, shelve
@@
-729,7
+731,7
@@
class P4Sync(Command):
self.initialParents = {}
self.listExistingP4GitBranches()
self.initialParents = {}
self.listExistingP4GitBranches()
- if len(self.p4BranchesInGit) > 1:
+ if len(self.p4BranchesInGit) > 1
and not self.silent
:
print "Importing from/into multiple branches"
self.detectBranches = True
print "Importing from/into multiple branches"
self.detectBranches = True
@@
-795,7
+797,7
@@
class P4Sync(Command):
self.depotPath = self.previousDepotPath
self.changeRange = "@%s,#head" % p4Change
self.initialParent = parseRevision(self.branch)
self.depotPath = self.previousDepotPath
self.changeRange = "@%s,#head" % p4Change
self.initialParent = parseRevision(self.branch)
- if not self.silent:
+ if not self.silent
and not self.detectBranches
:
print "Performing incremental import into %s git branch" % self.branch
if not self.branch.startswith("refs/"):
print "Performing incremental import into %s git branch" % self.branch
if not self.branch.startswith("refs/"):
@@
-920,15
+922,17
@@
class P4Sync(Command):
if len(changes) == 0:
if not self.silent:
if len(changes) == 0:
if not self.silent:
- print "
n
o changes to import!"
+ print "
N
o changes to import!"
return True
return True
+ self.updatedBranches = set()
+
cnt = 1
for change in changes:
description = p4Cmd("describe %s" % change)
if not self.silent:
cnt = 1
for change in changes:
description = p4Cmd("describe %s" % change)
if not self.silent:
- sys.stdout.write("\r
i
mporting revision %s (%s%%)" % (change, cnt * 100 / len(changes)))
+ sys.stdout.write("\r
I
mporting revision %s (%s%%)" % (change, cnt * 100 / len(changes)))
sys.stdout.flush()
cnt = cnt + 1
sys.stdout.flush()
cnt = cnt + 1
@@
-945,6
+949,8
@@
class P4Sync(Command):
if self.verbose:
print "branch is %s" % branch
if self.verbose:
print "branch is %s" % branch
+ self.updatedBranches.add(branch)
+
if branch not in self.createdBranches:
self.createdBranches.add(branch)
parent = self.knownBranches[branch]
if branch not in self.createdBranches:
self.createdBranches.add(branch)
parent = self.knownBranches[branch]
@@
-984,8
+990,13
@@
class P4Sync(Command):
print self.gitError.read()
sys.exit(1)
print self.gitError.read()
sys.exit(1)
- if not self.silent:
- print ""
+ if not self.silent:
+ print ""
+ if len(self.updatedBranches) > 0:
+ sys.stdout.write("Updated branches: ")
+ for b in self.updatedBranches:
+ sys.stdout.write("%s " % b)
+ sys.stdout.write("\n")
self.gitStream.close()
self.gitStream.close()