Browse Source

thinko: really ignore deleted files.

Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
maint
Han-Wen Nienhuys 18 years ago
parent
commit
b1ce944726
  1. 28
      contrib/fast-import/git-p4

28
contrib/fast-import/git-p4

@ -173,13 +173,18 @@ class P4Debug(Command):
def __init__(self): def __init__(self):
Command.__init__(self) Command.__init__(self)
self.options = [ 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.description = "A tool to debug the output of p4 -G."
self.needsGit = False 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 print output
return True return True


@ -676,24 +681,27 @@ class P4Sync(Command):


## Should move this out, doesn't use SELF. ## Should move this out, doesn't use SELF.
def readP4Files(self, files): 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 specs: if not files:
return return


filedata = p4CmdList('print %s' % ' '.join(['"%s"' % path filedata = p4CmdList('print %s' % ' '.join(['"%s#%s"' % (f['path'],
for (path, info) in specs])) f['rev'])
for f in files]))


j = 0; j = 0;
contents = {} contents = {}
while filedata[j:]: while j < len(filedata):
stat = filedata[j] stat = filedata[j]
text = filedata[j+1] j += 1
j += 2 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
contents[stat['depotFile']] = text['data']


for f in files: for f in files:
assert not f.has_key('data') assert not f.has_key('data')

Loading…
Cancel
Save