Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
thinko: really ignore deleted files.
author
Han-Wen Nienhuys
<hanwen@google.com>
Wed, 23 May 2007 21:49:35 +0000
(18:49 -0300)
committer
Han-Wen Nienhuys
<hanwen@google.com>
Thu, 31 May 2007 17:21:58 +0000
(14:21 -0300)
Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
contrib/fast-import/git-p4
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (from parent 1:
b17f88b
)
diff --git
a/contrib/fast-import/git-p4
b/contrib/fast-import/git-p4
index 5dae1f19ae9180a2a4b365295352e491936dcecb..294c2ecfcaeb2feab7822d1f7a6d3a20416a4910 100755
(executable)
--- a/
contrib/fast-import/git-p4
+++ b/
contrib/fast-import/git-p4
@@
-173,13
+173,18
@@
class P4Debug(Command):
def __init__(self):
Command.__init__(self)
self.options = [
def __init__(self):
Command.__init__(self)
self.options = [
- optparse.make_option("--verbose", dest="verbose", action="store_true"),
+ optparse.make_option("--verbose", dest="verbose", action="store_true",
+ default=False),
]
self.description = "A tool to debug the output of p4 -G."
self.needsGit = False
]
self.description = "A tool to debug the output of p4 -G."
self.needsGit = False
+ self.verbose = False
def run(self, args):
def run(self, args):
+ j = 0
for output in p4CmdList(" ".join(args)):
for output in p4CmdList(" ".join(args)):
+ print 'Element: %d' % j
+ j += 1
print output
return True
print output
return True
@@
-676,24
+681,27
@@
class P4Sync(Command):
## Should move this out, doesn't use SELF.
def readP4Files(self, files):
## Should move this out, doesn't use SELF.
def readP4Files(self, files):
-
specs = [(f['path'] + "#" + f['rev'], f)
for f in files
+
files = [f
for f in files
if f['action'] != 'delete']
if f['action'] != 'delete']
- if not
spec
s:
+ if not
file
s:
return
return
- filedata = p4CmdList('print %s' % ' '.join(['"%s"' % path
- for (path, info) in specs]))
+ filedata = p4CmdList('print %s' % ' '.join(['"%s#%s"' % (f['path'],
+ f['rev'])
+ for f in files]))
j = 0;
contents = {}
j = 0;
contents = {}
- while
filedata[j:]
:
+ while
j < len(filedata)
:
stat = filedata[j]
stat = filedata[j]
- text = filedata[j+1]
- j += 2
+ j += 1
+ text = ''
+ while j < len(filedata) and filedata[j]['code'] == 'text':
+ text += filedata[j]['data']
+ j += 1
- assert stat['code'] == 'stat' and text['code'] == 'text'
- contents[stat['depotFile']] = text['data']
+ contents[stat['depotFile']] = text
for f in files:
assert not f.has_key('data')
for f in files:
assert not f.has_key('data')