summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 711544b)
raw | patch | inline | side by side (parent: 711544b)
author | Simon Hausmann <simon@lst.de> | |
Sat, 7 Apr 2007 21:46:50 +0000 (23:46 +0200) | ||
committer | Simon Hausmann <simon@lst.de> | |
Sat, 7 Apr 2007 21:46:50 +0000 (23:46 +0200) |
Signed-off-by: Simon Hausmann <simon@lst.de>
contrib/fast-import/git-p4 | patch | blob | history | |
contrib/fast-import/git-p4.txt | patch | blob | history |
index 24c8e66e87057a2893dd0a475c5e9c2241984aed..aa85800d697f25518886dcd5d1826eb1eef91958 100755 (executable)
def getLabels(self):
self.labels = {}
- for output in p4CmdList("labels %s..." % self.globalPrefix):
+ l = p4CmdList("labels %s..." % self.globalPrefix)
+ if len(l) > 0:
+ print "Finding files belonging to labels in %s" % self.globalPrefix
+
+ for output in l:
label = output["label"]
revisions = {}
newestChange = 0
return True
+class P4Rebase(Command):
+ def __init__(self):
+ Command.__init__(self)
+ self.options = [ ]
+ self.description = "Fetches the latest revision from perforce and rebases the current work (branch) against it"
+
+ def run(self, args):
+ sync = P4Sync()
+ sync.run([])
+ print "Rebasing the current branch"
+ system("git rebase p4")
+ return True
+
class HelpFormatter(optparse.IndentedHelpFormatter):
def __init__(self):
optparse.IndentedHelpFormatter.__init__(self)
"debug" : P4Debug(),
"clean-tags" : P4CleanTags(),
"submit" : P4Submit(),
- "sync" : P4Sync()
+ "sync" : P4Sync(),
+ "rebase" : P4Rebase()
}
if len(sys.argv[1:]) == 0:
index 30e2cb9a559bec3c6a31157a51581426ae412ad1..5f7251c2d6d626da9d2e16771df5ab6f486895d9 100644 (file)
git-p4 sync
-in your git repository.
+in your git repository. By default the "p4" branch is updated.
It is recommended to run 'git repack -a -d -f' from time to time when using
incremental imports to optimally combine the individual git packs that each
incremental import creates through the use of git-fast-import.
+Updating
+========
+
+A common working pattern is to fetch the latest changes from the Perforce depot
+and merge them with local uncommitted changes. The recommended way is to use
+git's rebase mechanism to preserve linear history. git-p4 provides a convenient
+
+ git-p4 rebase
+
+command that calls git-p4 sync followed by git rebase to rebase the current
+working branch.
+
Submitting
==========