comparison hgext3rd/fastimport/hgimport.py @ 92:efe678b023d3

Whitespace police
author Roy Marples <roy@marples.name>
date Wed, 20 Jan 2021 21:53:47 +0000
parents e6602cc471d5
children 2ce33511de87
comparison
equal deleted inserted replaced
91:c305720d5b7c 92:efe678b023d3
90 90
91 def gettags(self): 91 def gettags(self):
92 """Return the tags as a dictionary of name: revision""" 92 """Return the tags as a dictionary of name: revision"""
93 # oops, this loses order 93 # oops, this loses order
94 return dict(self.processor.tags) 94 return dict(self.processor.tags)
95 95
96 def getchangedfiles(self, rev, i): 96 def getchangedfiles(self, rev, i):
97 """Return the files changed by rev compared to parent[i]. 97 """Return the files changed by rev compared to parent[i].
98 98
99 i is an index selecting one of the parents of rev. The return 99 i is an index selecting one of the parents of rev. The return
100 value should be the list of files that are different in rev and 100 value should be the list of files that are different in rev and
124 infile.close() 124 infile.close()
125 self.parsed = True 125 self.parsed = True
126 126
127 127
128 class HgImportProcessor(processor.ImportProcessor): 128 class HgImportProcessor(processor.ImportProcessor):
129 129
130 tagprefix = b"refs/tags/" 130 tagprefix = b"refs/tags/"
131 131
132 def __init__(self, ui, repo): 132 def __init__(self, ui, repo):
133 super(HgImportProcessor, self).__init__() 133 super(HgImportProcessor, self).__init__()
134 self.ui = ui 134 self.ui = ui
343 #print type((0, 0)), type(res), len(res), type(res) is type((0, 0)) 343 #print type((0, 0)), type(res), len(res), type(res) is type((0, 0))
344 #if type(res) is type((0, 0)) and len(res) == 2: 344 #if type(res) is type((0, 0)) and len(res) == 2:
345 # print "go for it" 345 # print "go for it"
346 #return res 346 #return res
347 return b"%d %d" % res 347 return b"%d %d" % res
348 348
349 def reset_handler(self, cmd): 349 def reset_handler(self, cmd):
350 branch = self._getbranch(cmd.ref) 350 branch = self._getbranch(cmd.ref)
351 if branch: 351 if branch:
352 # The usual case for 'reset': (re)create the named branch. 352 # The usual case for 'reset': (re)create the named branch.
353 # XXX what should we do if cmd.from_ is None? 353 # XXX what should we do if cmd.from_ is None?
398 # dictionary of src: dest (renamed files are in here and self.modified) 398 # dictionary of src: dest (renamed files are in here and self.modified)
399 self.copies = {} 399 self.copies = {}
400 400
401 # number of inline files seen in this commit 401 # number of inline files seen in this commit
402 self.inlinecount = 0 402 self.inlinecount = 0
403 403
404 def modify_handler(self, filecmd): 404 def modify_handler(self, filecmd):
405 if filecmd.dataref: 405 if filecmd.dataref:
406 blobid = filecmd.dataref # blobid is the mark of the blob 406 blobid = filecmd.dataref # blobid is the mark of the blob
407 else: 407 else:
408 blobid = b"%s-inline:%d" % (self.command.id, self.inlinecount) 408 blobid = b"%s-inline:%d" % (self.command.id, self.inlinecount)