summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: af8da89)
raw | patch | inline | side by side (parent: af8da89)
author | Simon Hausmann <shausman@trolltech.com> | |
Mon, 21 May 2007 21:44:24 +0000 (23:44 +0200) | ||
committer | Simon Hausmann <shausman@trolltech.com> | |
Mon, 21 May 2007 21:44:24 +0000 (23:44 +0200) |
Signed-off-by: Simon Hausmann <shausman@trolltech.com>
contrib/fast-import/git-p4 | patch | blob | history |
index 515f7a906ff1f83621a1b917a7ead4ff0fc1eeac..1457396abd8d006f82e4237acd2979ef49aab487 100755 (executable)
def __init__(self):
Command.__init__(self)
self.options = [
+ optparse.make_option("--verbose", dest="verbose", action="store_true")
]
self.description = "A tool to debug the multi-branch import. Don't use :)"
+ self.verbose = False
def run(self, args):
if len(args) != 1:
log = extractLogMessageFromGitCommit(ref)
depotPath, change = extractDepotPathAndChangeFromGitLog(log)
changed = False
+
+ if len(p4Cmd("changes -m 1 %s...@%s" % (depotPath, maxChange))) == 0:
+ print "Branch %s did not exist at change %s, deleting." % (ref, maxChange)
+ system("git update-ref -d %s `git rev-parse %s`" % (ref, ref))
+ continue
+
while len(change) > 0 and int(change) > maxChange:
changed = True
- print "%s is at %s ; rewinding towards %s" % (ref, change, maxChange)
+ if self.verbose:
+ print "%s is at %s ; rewinding towards %s" % (ref, change, maxChange)
system("git update-ref %s \"%s^\"" % (ref, ref))
log = extractLogMessageFromGitCommit(ref)
depotPath, change = extractDepotPathAndChangeFromGitLog(log)
if changed:
- print "%s is at %s" % (ref, change)
+ print "%s rewound to %s" % (ref, change)
return True