зеркало из https://github.com/microsoft/git.git
Load the user map from p4 only once at run-time.
Signed-off-by: Simon Hausmann <simon@lst.de>
This commit is contained in:
Родитель
b3fd1b2808
Коммит
ebd8116870
|
@ -697,6 +697,8 @@ class P4Sync(Command):
|
||||||
print "Tag %s does not match with change %s: file count is different." % (labelDetails["label"], change)
|
print "Tag %s does not match with change %s: file count is different." % (labelDetails["label"], change)
|
||||||
|
|
||||||
def getUserMapFromPerforceServer(self):
|
def getUserMapFromPerforceServer(self):
|
||||||
|
if self.userMapFromPerforceServer:
|
||||||
|
return
|
||||||
self.users = {}
|
self.users = {}
|
||||||
|
|
||||||
for output in p4CmdList("users"):
|
for output in p4CmdList("users"):
|
||||||
|
@ -708,9 +710,11 @@ class P4Sync(Command):
|
||||||
for user in self.users.keys():
|
for user in self.users.keys():
|
||||||
cache.write("%s\t%s\n" % (user, self.users[user]))
|
cache.write("%s\t%s\n" % (user, self.users[user]))
|
||||||
cache.close();
|
cache.close();
|
||||||
|
self.userMapFromPerforceServer = True
|
||||||
|
|
||||||
def loadUserMapFromCache(self):
|
def loadUserMapFromCache(self):
|
||||||
self.users = {}
|
self.users = {}
|
||||||
|
self.userMapFromPerforceServer = False
|
||||||
try:
|
try:
|
||||||
cache = open(gitdir + "/p4-usercache.txt", "rb")
|
cache = open(gitdir + "/p4-usercache.txt", "rb")
|
||||||
lines = cache.readlines()
|
lines = cache.readlines()
|
||||||
|
|
Загрузка…
Ссылка в новой задаче