aboutsummaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authorJohn Chapman <thestar@fussycoder.id.au>2008-11-08 14:22:48 +1100
committerJunio C Hamano <gitster@pobox.com>2008-11-11 14:50:03 -0800
commit7f96e2e25aa008556a4ede7a65de8488eb9890e6 (patch)
treef29e2b6d6bd4c279bcc72a0d522ade1618a38ae7 /contrib
parent42fc1139a07b4292d3e5251c591609126664941a (diff)
downloadgit-7f96e2e25aa008556a4ede7a65de8488eb9890e6.tar.gz
git-7f96e2e25aa008556a4ede7a65de8488eb9890e6.tar.xz
git-p4: Support purged files and optimize memory usage
Purged files are handled as if they are merely deleted, which is not entirely optimal, but I don't know of any other way to handle them. File data is deleted from memory as early as they can, and they are more efficiently handled, at (significant) cost to CPU usage. Still need to handle p4 branches with spaces in their names. Still need to make git-p4 clone more reliable. - Perhaps with a --continue option. (Sometimes the p4 server kills the connection) Signed-off-by: John Chapman <thestar@fussycoder.id.au> Acked-by: Simon Hausmann <simon@lst.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'contrib')
-rwxr-xr-xcontrib/fast-import/git-p414
1 files changed, 7 insertions, 7 deletions
diff --git a/contrib/fast-import/git-p4 b/contrib/fast-import/git-p4
index 2216cacba..38d1a1733 100755
--- a/contrib/fast-import/git-p4
+++ b/contrib/fast-import/git-p4
@@ -946,7 +946,7 @@ class P4Sync(Command):
if includeFile:
filesForCommit.append(f)
- if f['action'] != 'delete':
+ if f['action'] not in ('delete', 'purge'):
filesToRead.append(f)
filedata = []
@@ -965,11 +965,11 @@ class P4Sync(Command):
while j < len(filedata):
stat = filedata[j]
j += 1
- text = [];
+ text = ''
while j < len(filedata) and filedata[j]['code'] in ('text', 'unicode', 'binary'):
- text.append(filedata[j]['data'])
+ text += filedata[j]['data']
+ del filedata[j]['data']
j += 1
- text = ''.join(text)
if not stat.has_key('depotFile'):
sys.stderr.write("p4 print fails with: %s\n" % repr(stat))
@@ -1038,7 +1038,7 @@ class P4Sync(Command):
continue
relPath = self.stripRepoPath(file['path'], branchPrefixes)
- if file["action"] == "delete":
+ if file["action"] in ("delete", "purge"):
self.gitStream.write("D %s\n" % relPath)
else:
data = file['data']
@@ -1077,7 +1077,7 @@ class P4Sync(Command):
cleanedFiles = {}
for info in files:
- if info["action"] == "delete":
+ if info["action"] in ("delete", "purge"):
continue
cleanedFiles[info["depotFile"]] = info["rev"]
@@ -1400,7 +1400,7 @@ class P4Sync(Command):
if change > newestRevision:
newestRevision = change
- if info["action"] == "delete":
+ if info["action"] in ("delete", "purge"):
# don't increase the file cnt, otherwise details["depotFile123"] will have gaps!
#fileCnt = fileCnt + 1
continue