summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 9bda3a8)
raw | patch | inline | side by side (parent: 9bda3a8)
author | Simon Hausmann <simon@lst.de> | |
Sun, 20 May 2007 08:55:54 +0000 (10:55 +0200) | ||
committer | Simon Hausmann <simon@lst.de> | |
Sun, 20 May 2007 08:55:54 +0000 (10:55 +0200) |
Signed-off-by: Simon Hausmann <simon@lst.de>
contrib/fast-import/git-p4 | patch | blob | history |
index f76d198d64739a9d8f540b57f5a4c73604f4cbe2..e5e7c6be12d97d0ec436dbdcede040db30f3717d 100755 (executable)
# gitStream.write("mark :%s\n" % details["change"])
self.committedChanges.add(int(details["change"]))
committer = ""
+ if author not in self.users:
+ self.getUserMapFromPerforceServer()
if author in self.users:
committer = "%s %s %s" % (self.users[author], epoch, self.tz)
else:
if not self.silent:
print "Tag %s does not match with change %s: file count is different." % (labelDetails["label"], change)
- def getUserMap(self):
+ def getUserMapFromPerforceServer(self):
self.users = {}
for output in p4CmdList("users"):
continue
self.users[output["User"]] = output["FullName"] + " <" + output["Email"] + ">"
+ cache = open(gitdir + "/p4-usercache.txt", "wb")
+ for user in self.users.keys():
+ cache.write("%s\t%s\n" % (user, self.users[user]))
+ cache.close();
+
+ def loadUserMapFromCache(self):
+ self.users = {}
+ try:
+ cache = open(gitdir + "/p4-usercache.txt", "rb")
+ lines = cache.readlines()
+ cache.close()
+ for line in lines:
+ entry = line[:-1].split("\t")
+ self.users[entry[0]] = entry[1]
+ except IOError:
+ self.getUserMapFromPerforceServer()
+
def getLabels(self):
self.labels = {}
if not self.depotPath.endswith("/"):
self.depotPath += "/"
- self.getUserMap()
+ self.loadUserMapFromCache()
self.labels = {}
if self.detectLabels:
self.getLabels();