summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: a3287be)
raw | patch | inline | side by side (parent: a3287be)
author | Han-Wen Nienhuys <hanwen@google.com> | |
Wed, 23 May 2007 21:49:35 +0000 (18:49 -0300) | ||
committer | Han-Wen Nienhuys <hanwen@google.com> | |
Wed, 30 May 2007 19:57:59 +0000 (16:57 -0300) |
Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
contrib/fast-import/git-p4 | patch | blob | history |
index 01efd92809acab951d550fd69776912174f56eb5..d1989e613434a1c2a245a2508892518ba481ea00 100755 (executable)
next_spec, next_info = specs[j+1]
end = data.find(next_spec, start)
+ if end < 0:
+ print spec, next_spec
+
assert end >= 0
else:
end = len(data)
if self.verbose:
print "commit into %s" % branch
+ # start with reading files; if that fails, we should not
+ # create a commit.
+ new_files = []
+ for f in files:
+ if [p for p in branchPrefixes if f['path'].startswith(p)]:
+ new_files.append (f)
+ else:
+ sys.stderr.write("Ignoring file outside of prefix: %s\n" % path)
+ files = new_files
+ self.readP4Files(files)
+
+
+
+
self.gitStream.write("commit %s\n" % branch)
# gitStream.write("mark :%s\n" % details["change"])
self.committedChanges.add(int(details["change"]))
print "parent %s" % parent
self.gitStream.write("from %s\n" % parent)
-
- new_files = []
- for f in files:
- if [p for p in branchPrefixes if f['path'].startswith(p)]:
- new_files.append (f)
- else:
- sys.stderr.write("Ignoring file outside of prefix: %s\n" % path)
- files = new_files
-
- self.readP4Files(files)
for file in files:
if file["type"] == "apple":
print "\nfile %s is a strange apple file that forks. Ignoring!" % file['path']
settings = extractSettingsGitLog(logMsg)
- if self.verbose:
- print "path %s change %s" % (','.join(depotPaths), change)
-
self.readOptions(settings)
if (settings.has_key('depot-paths')
and settings.has_key ('change')):
+ ' '.join(["%s...%s"
% (p, self.revision)
for p in self.depotPaths])):
+
+ if not info.has_key("change"):
+ print info
change = int(info["change"])
if change > newestRevision:
newestRevision = change
#fileCnt = fileCnt + 1
continue
- for prop in [ "depotFile", "rev", "action", "type" ]:
+ for prop in ["depotFile", "rev", "action", "type" ]:
details["%s%s" % (prop, fileCnt)] = info[prop]
fileCnt = fileCnt + 1