git-p4: Fix p4 user cache population on Windows.
authorSimon Hausmann <simon@lst.de>
Wed, 25 Jul 2007 07:31:38 +0000 (09:31 +0200)
committerJunio C Hamano <gitster@pobox.com>
Wed, 25 Jul 2007 23:06:54 +0000 (16:06 -0700)
Fall back to USERPROFILE if HOME isn't set.

Signed-off-by: Simon Hausmann <shausman@trolltech.com>
Signed-off-by: Marius Storm-Olsen <marius@trolltech.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
contrib/fast-import/git-p4

index e3404ca..1f5a56e 100755 (executable)
@@ -901,7 +901,8 @@ class P4Sync(Command):
                            % (labelDetails["label"], change))
 
     def getUserCacheFilename(self):
                            % (labelDetails["label"], change))
 
     def getUserCacheFilename(self):
-        return os.environ["HOME"] + "/.gitp4-usercache.txt"
+        home = os.environ.get("HOME", os.environ.get("USERPROFILE"))
+        return home + "/.gitp4-usercache.txt"
 
     def getUserMapFromPerforceServer(self):
         if self.userMapFromPerforceServer:
 
     def getUserMapFromPerforceServer(self):
         if self.userMapFromPerforceServer: