summaryrefslogtreecommitdiff
path: root/contrib/fast-import/git-p4
diff options
context:
space:
mode:
authorLibravatar Simon Hausmann <shausman@trolltech.com>2007-05-23 00:07:35 +0200
committerLibravatar Simon Hausmann <shausman@trolltech.com>2007-05-23 00:07:35 +0200
commit01a9c9c5a80c6a1e82298870ca8e5bc73b2a828d (patch)
tree6a4b7a60d62a82ac8e46fe042305880cafe081f3 /contrib/fast-import/git-p4
parentAdded support for importing multiple branches into refs/heads instead of just... (diff)
downloadtgif-01a9c9c5a80c6a1e82298870ca8e5bc73b2a828d.tar.xz
Added support for --max-changes=<count> to ease import debugging
Signed-off-by: Simon Hausmann <shausman@trolltech.com>
Diffstat (limited to 'contrib/fast-import/git-p4')
-rwxr-xr-xcontrib/fast-import/git-p47
1 files changed, 6 insertions, 1 deletions
diff --git a/contrib/fast-import/git-p4 b/contrib/fast-import/git-p4
index 969c1fe45b..3d97ce1a24 100755
--- a/contrib/fast-import/git-p4
+++ b/contrib/fast-import/git-p4
@@ -499,7 +499,8 @@ class P4Sync(Command):
optparse.make_option("--detect-labels", dest="detectLabels", action="store_true"),
optparse.make_option("--with-origin", dest="syncWithOrigin", action="store_true"),
optparse.make_option("--verbose", dest="verbose", action="store_true"),
- optparse.make_option("--import-local", dest="importIntoRemotes", action="store_false")
+ optparse.make_option("--import-local", dest="importIntoRemotes", action="store_false"),
+ optparse.make_option("--max-changes", dest="maxChanges")
]
self.description = """Imports from Perforce into a git repository.\n
example:
@@ -521,6 +522,7 @@ class P4Sync(Command):
self.syncWithOrigin = False
self.verbose = False
self.importIntoRemotes = True
+ self.maxChanges = ""
def p4File(self, depotPath):
return os.popen("p4 print -q \"%s\"" % depotPath, "rb").read()
@@ -971,6 +973,9 @@ class P4Sync(Command):
changes.reverse()
+ if len(self.maxChanges) > 0:
+ changes = changes[0:min(int(self.maxChanges), len(changes))]
+
if len(changes) == 0:
if not self.silent:
print "No changes to import!"