From: Simon Hausmann Date: Thu, 22 Mar 2007 20:27:14 +0000 (+0100) Subject: Helper function to check the existance of a revision X-Git-Url: http://crossforests.com/gitweb?a=commitdiff_plain;h=8136a6399c886dec8d1b806a7d8728324e906729;p=python%2Ffast-export.git Helper function to check the existance of a revision Signed-off-by: Simon Hausmann --- diff --git a/contrib/fast-import/git-p4 b/contrib/fast-import/git-p4 index 6ead1c4..b21dee3 100755 --- a/contrib/fast-import/git-p4 +++ b/contrib/fast-import/git-p4 @@ -83,6 +83,9 @@ def extractDepotPathAndChangeFromGitLog(log): return values.get("depot-path"), values.get("change") +def gitBranchExists(branch): + return os.system("git-rev-parse %s 2>/dev/null >/dev/null") == 0 + class Command: def __init__(self): self.usage = "usage: %prog [options]"