summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: e20a9e5)
raw | patch | inline | side by side (parent: e20a9e5)
author | Simon Hausmann <hausmann@kde.org> | |
Mon, 26 Mar 2007 06:18:55 +0000 (08:18 +0200) | ||
committer | Simon Hausmann <hausmann@kde.org> | |
Mon, 26 Mar 2007 06:18:55 +0000 (08:18 +0200) |
Signed-off-by: Simon Hausmann <hausmann@kde.org>
contrib/fast-import/git-p4 | patch | blob | history |
index 5b023b1b7a092cd322a2f40d09c590f1ccf0921e..eb5b40aa98d23ea6ad2ea17acd027b829b876e57 100755 (executable)
class Command:
def __init__(self):
self.usage = "usage: %prog [options]"
+ self.needsGit = True
class P4Debug(Command):
def __init__(self):
self.options = [
]
self.description = "A tool to debug the output of p4 -G."
+ self.needsGit = False
def run(self, args):
for output in p4CmdList(" ".join(args)):
(cmd, args) = parser.parse_args(sys.argv[2:], cmd);
-gitdir = cmd.gitdir
-if len(gitdir) == 0:
- gitdir = ".git"
- if not isValidGitDir(gitdir):
- cdup = os.popen("git rev-parse --show-cdup").read()[:-1]
- if isValidGitDir(cdup + "/" + gitdir):
- os.chdir(cdup)
+if cmd.needsGit:
+ gitdir = cmd.gitdir
+ if len(gitdir) == 0:
+ gitdir = ".git"
+ if not isValidGitDir(gitdir):
+ cdup = os.popen("git rev-parse --show-cdup").read()[:-1]
+ if isValidGitDir(cdup + "/" + gitdir):
+ os.chdir(cdup)
-if not isValidGitDir(gitdir):
- if isValidGitDir(gitdir + "/.git"):
- gitdir += "/.git"
- else:
- die("fatal: cannot locate git repository at %s" % gitdir)
+ if not isValidGitDir(gitdir):
+ if isValidGitDir(gitdir + "/.git"):
+ gitdir += "/.git"
+ else:
+ die("fatal: cannot locate git repository at %s" % gitdir)
-os.environ["GIT_DIR"] = gitdir
+ os.environ["GIT_DIR"] = gitdir
if not cmd.run(args):
parser.print_help()