From: Simon Hausmann Date: Wed, 23 May 2007 22:24:52 +0000 (+0200) Subject: Load the user map from p4 only once at run-time. X-Git-Tag: v1.5.3-rc0~65^2^2~63 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=ebd8116870247fbc9fb27656d28f1b8a43aae766;p=git.git Load the user map from p4 only once at run-time. Signed-off-by: Simon Hausmann --- diff --git a/contrib/fast-import/git-p4 b/contrib/fast-import/git-p4 index d8b7080b4..9e9d623a3 100755 --- a/contrib/fast-import/git-p4 +++ b/contrib/fast-import/git-p4 @@ -697,6 +697,8 @@ class P4Sync(Command): print "Tag %s does not match with change %s: file count is different." % (labelDetails["label"], change) def getUserMapFromPerforceServer(self): + if self.userMapFromPerforceServer: + return self.users = {} for output in p4CmdList("users"): @@ -708,9 +710,11 @@ class P4Sync(Command): for user in self.users.keys(): cache.write("%s\t%s\n" % (user, self.users[user])) cache.close(); + self.userMapFromPerforceServer = True def loadUserMapFromCache(self): self.users = {} + self.userMapFromPerforceServer = False try: cache = open(gitdir + "/p4-usercache.txt", "rb") lines = cache.readlines()