summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: b016d39)
raw | patch | inline | side by side (parent: b016d39)
author | Han-Wen Nienhuys <hanwen@google.com> | |
Wed, 23 May 2007 20:14:33 +0000 (17:14 -0300) | ||
committer | Han-Wen Nienhuys <hanwen@google.com> | |
Mon, 28 May 2007 14:15:43 +0000 (11:15 -0300) |
- use re.sub() iso. if for stripping ...
- spacing nits
Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
- spacing nits
Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
contrib/fast-import/git-p4 | patch | blob | history |
index 05b308f5be19f1aad5bf45b4215a6bdbc5eb54ec..8d649dd7628fd9c8079549a9bb73548255512481 100755 (executable)
gitdir = os.environ.get("GIT_DIR", "")
silent = False
-def write_pipe (c, str):
+def write_pipe(c, str):
if not silent:
- sys.stderr.write ('writing pipe: %s\n' % c)
+ sys.stderr.write('writing pipe: %s\n' % c)
## todo: check return status
- pipe = os.popen (c, 'w')
+ pipe = os.popen(c, 'w')
val = pipe.write(str)
- if pipe.close ():
- sys.stderr.write ('Command failed')
- sys.exit (1)
+ if pipe.close():
+ sys.stderr.write('Command failed')
+ sys.exit(1)
return val
-def read_pipe (c):
- sys.stderr.write ('reading pipe: %s\n' % c)
+def read_pipe(c):
+ sys.stderr.write('reading pipe: %s\n' % c)
## todo: check return status
- pipe = os.popen (c, 'rb')
+ pipe = os.popen(c, 'rb')
val = pipe.read()
- if pipe.close ():
- sys.stderr.write ('Command failed')
- sys.exit (1)
+ if pipe.close():
+ sys.stderr.write('Command failed')
+ sys.exit(1)
return val
-def read_pipe_lines (c):
- sys.stderr.write ('reading pipe: %s\n' % c)
+def read_pipe_lines(c):
+ sys.stderr.write('reading pipe: %s\n' % c)
## todo: check return status
- pipe = os.popen (c, 'rb')
+ pipe = os.popen(c, 'rb')
val = pipe.readlines()
- if pipe.close ():
- sys.stderr.write ('Command failed')
- sys.exit (1)
+ if pipe.close():
+ sys.stderr.write('Command failed')
+ sys.exit(1)
return val
elif len(self.previousDepotPath) == 0:
self.revision = "#head"
- if self.depotPath.endswith("..."):
- self.depotPath = self.depotPath[:-3]
-
+ self.depotPath = re.sub ("\.\.\.$", "", self.depotPath)
if not self.depotPath.endswith("/"):
self.depotPath += "/"