Fix git-p4 submit
[gitweb.git] / contrib / fast-import / git-p4
index ff737d762cdddcbe80828e725911ab88c62bf48d..8be0afe8284f832e1058770a66c5b261e8ebd500 100755 (executable)
@@ -276,6 +276,7 @@ class P4Submit(Command):
         self.origin = ""
         self.directSubmit = False
         self.trustMeLikeAFool = False
+        self.verbose = False
 
         self.logSubstitutions = {}
         self.logSubstitutions["<enter description here>"] = "%log%"
@@ -478,9 +479,6 @@ class P4Submit(Command):
                    % (fileName, fileName))
 
     def run(self, args):
-        # make gitdir absolute so we can cd out into the perforce checkout
-        os.environ["GIT_DIR"] = gitdir
-
         if len(args) == 0:
             self.master = currentGitBranch()
             if len(self.master) == 0 or not gitBranchExists("refs/heads/%s" % self.master):
@@ -909,9 +907,10 @@ class P4Sync(Command):
                     continue
                 source = paths[0]
                 destination = paths[1]
-                if source.startswith(self.depotPath) and destination.startswith(self.depotPath):
-                    source = source[len(self.depotPath):-4]
-                    destination = destination[len(self.depotPath):-4]
+                ## HACK
+                if source.startswith(self.depotPaths[0]) and destination.startswith(self.depotPaths[0]):
+                    source = source[len(self.depotPaths[0]):-4]
+                    destination = destination[len(self.depotPaths[0]):-4]
                     if destination not in self.knownBranches:
                         self.knownBranches[destination] = source
                     if source not in self.knownBranches:
@@ -1319,6 +1318,7 @@ class P4Rebase(Command):
         self.options = [ ]
         self.description = ("Fetches the latest revision from perforce and "
                             + "rebases the current work (branch) against it")
+        self.verbose = False
 
     def run(self, args):
         sync = P4Sync()