diff options
author | Han-Wen Nienhuys <hanwen@google.com> | 2007-05-23 18:49:35 -0300 |
---|---|---|
committer | Han-Wen Nienhuys <hanwen@google.com> | 2007-05-30 16:35:32 -0300 |
commit | 183b8ef89be041cd50803427cfc46fe1afed17bb (patch) | |
tree | 88ca9a5c252a5c7fb7f8a8c2590d937142bc06fd /contrib/fast-import | |
parent | Thinko, fix buglet. (diff) | |
download | tgif-183b8ef89be041cd50803427cfc46fe1afed17bb.tar.xz |
store p4 user cache in home directory.
Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
Diffstat (limited to 'contrib/fast-import')
-rwxr-xr-x | contrib/fast-import/git-p4 | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/contrib/fast-import/git-p4 b/contrib/fast-import/git-p4 index f1f562fae4..bd1afb2964 100755 --- a/contrib/fast-import/git-p4 +++ b/contrib/fast-import/git-p4 @@ -819,6 +819,9 @@ class P4Sync(Command): print ("Tag %s does not match with change %s: file count is different." % (labelDetails["label"], change)) + def getUserCacheFilename(self): + return os.environ["HOME"] + "/.gitp4-usercache.txt") + def getUserMapFromPerforceServer(self): if self.userMapFromPerforceServer: return @@ -829,17 +832,19 @@ class P4Sync(Command): continue self.users[output["User"]] = output["FullName"] + " <" + output["Email"] + ">" - cache = open(self.gitdir + "/p4-usercache.txt", "wb") - for user in self.users.keys(): - cache.write("%s\t%s\n" % (user, self.users[user])) - cache.close(); + + s = '' + for (key, val) in self.users.items(): + s += "%s\t%s\n" % (key, val) + + open(self.getUserCacheFilename(), "wb").write(s) self.userMapFromPerforceServer = True def loadUserMapFromCache(self): self.users = {} self.userMapFromPerforceServer = False try: - cache = open(self.gitdir + "/p4-usercache.txt", "rb") + cache = open(self.getUserCacheFilename(), "rb") lines = cache.readlines() cache.close() for line in lines: |