aboutsummaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorSimon Hausmann <shausman@trolltech.com>2007-05-23 20:07:57 +0200
committerSimon Hausmann <shausman@trolltech.com>2007-05-23 20:07:57 +0200
commit0c66a783936d5cd7b1f28400c6b192c37690304a (patch)
tree45d33ac0a267b76a82e766e6ecac22e7d3aeca72 /contrib
parent65d2ade95e6ef5a15a30d5115073477dfe03fb85 (diff)
downloadgit-0c66a783936d5cd7b1f28400c6b192c37690304a.tar.gz
git-0c66a783936d5cd7b1f28400c6b192c37690304a.tar.xz
Make rollback work with locally imported branches
Signed-off-by: Simon Hausmann <shausman@trolltech.com>
Diffstat (limited to 'contrib')
-rwxr-xr-xcontrib/fast-import/git-p418
1 files changed, 14 insertions, 4 deletions
diff --git a/contrib/fast-import/git-p4 b/contrib/fast-import/git-p4
index 5cea6cf9a..f12ad8baf 100755
--- a/contrib/fast-import/git-p4
+++ b/contrib/fast-import/git-p4
@@ -136,18 +136,28 @@ class P4RollBack(Command):
def __init__(self):
Command.__init__(self)
self.options = [
- optparse.make_option("--verbose", dest="verbose", action="store_true")
+ optparse.make_option("--verbose", dest="verbose", action="store_true"),
+ optparse.make_option("--local", dest="rollbackLocalBranches", action="store_true")
]
self.description = "A tool to debug the multi-branch import. Don't use :)"
self.verbose = False
+ self.rollbackLocalBranches = False
def run(self, args):
if len(args) != 1:
return False
maxChange = int(args[0])
- for line in mypopen("git rev-parse --symbolic --remotes").readlines():
- if line.startswith("p4/") and line != "p4/HEAD\n":
- ref = "refs/remotes/" + line[:-1]
+
+ if self.rollbackLocalBranches:
+ refPrefix = "refs/heads/"
+ lines = mypopen("git rev-parse --symbolic --branches").readlines()
+ else:
+ refPrefix = "refs/remotes/"
+ lines = mypopen("git rev-parse --symbolic --remotes").readlines()
+
+ for line in lines:
+ if self.rollbackLocalBranches or (line.startswith("p4/") and line != "p4/HEAD\n"):
+ ref = refPrefix + line[:-1]
log = extractLogMessageFromGitCommit(ref)
depotPath, change = extractDepotPathAndChangeFromGitLog(log)
changed = False