summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Simon Hausmann <hausmann@kde.org>2007-03-14 17:29:46 +0100
committerLibravatar Simon Hausmann <hausmann@kde.org>2007-03-14 17:31:47 +0100
commit794a913a0096a383560eb06e0fdf1d8331e12c0a (patch)
tree3968a09ef80f7c2aac2ac00b755f921a32326c17
parentLots of bugfixes to p4-git-sync. (diff)
downloadtgif-794a913a0096a383560eb06e0fdf1d8331e12c0a.tar.xz
Automatically operate on a temporary branch, needed for cherry-pick to work when applying changes to
files that are deleted in the future. Also do some Perforce cleaning Signed-off-by: Simon Hausmann <hausmann@kde.org>
-rwxr-xr-xcontrib/fast-import/p4-git-sync.py10
1 files changed, 9 insertions, 1 deletions
diff --git a/contrib/fast-import/p4-git-sync.py b/contrib/fast-import/p4-git-sync.py
index 5e307af8c6..02f4b36af3 100755
--- a/contrib/fast-import/p4-git-sync.py
+++ b/contrib/fast-import/p4-git-sync.py
@@ -97,7 +97,6 @@ def system(cmd):
die("command failed: %s" % cmd)
def check():
- return
if len(p4CmdList("opened ...")) > 0:
die("You have files opened with perforce! Close them before starting the sync.")
@@ -115,6 +114,9 @@ def start(config):
config["commits"] = commits
+ print "Creating temporary p4-sync branch from %s ..." % origin
+ system("git checkout -f -b p4-sync %s" % origin)
+
# print "Cleaning index..."
# system("git checkout -f")
@@ -264,5 +266,11 @@ if len(commits) == 0:
print "No changes found to apply between %s and current HEAD" % origin
else:
print "All changes applied!"
+ print "Deleting temporary p4-sync branch and going back to %s" % master
+ system("git checkout %s" % master)
+ system("git branch -D p4-sync")
+ print "Cleaning out your perforce checkout by doing p4 edit ... ; p4 revert -a ..."
+ system("p4 edit ...")
+ system("p4 revert -a ...")
os.remove(configFile)