##// END OF EJS Templates
convert: allow passing in a revmap...
David Soria Parra -
r30601:d47a01bf default
parent child Browse files
Show More
@@ -55,6 +55,7 b' class p4_source(common.converter_source)'
55
55
56 common.checktool('p4', abort=False)
56 common.checktool('p4', abort=False)
57
57
58 self.revmap = {}
58 self.p4changes = {}
59 self.p4changes = {}
59 self.heads = []
60 self.heads = []
60 self.changeset = {}
61 self.changeset = {}
@@ -77,6 +78,19 b' class p4_source(common.converter_source)'
77 "multiple revisions"))
78 "multiple revisions"))
78 self._parse(ui, path)
79 self._parse(ui, path)
79
80
81 def setrevmap(self, revmap):
82 """Sets the parsed revmap dictionary.
83
84 Revmap stores mappings from a source revision to a target revision.
85 It is set in convertcmd.convert and provided by the user as a file
86 on the commandline.
87
88 Revisions in the map are considered beeing present in the
89 repository and ignored during _parse(). This allows for incremental
90 imports if a revmap is provided.
91 """
92 self.revmap = revmap
93
80 def _parse_view(self, path):
94 def _parse_view(self, path):
81 "Read changes affecting the path"
95 "Read changes affecting the path"
82 cmd = 'p4 -G changes -s submitted %s' % util.shellquote(path)
96 cmd = 'p4 -G changes -s submitted %s' % util.shellquote(path)
@@ -132,6 +146,10 b' class p4_source(common.converter_source)'
132 continue
146 continue
133 if self.revs and int(change) > int(self.revs[0]):
147 if self.revs and int(change) > int(self.revs[0]):
134 continue
148 continue
149 if change in self.revmap:
150 # Ignore already present revisions, but set the parent pointer.
151 lastid = change
152 continue
135
153
136 cmd = "p4 -G describe -s %s" % change
154 cmd = "p4 -G describe -s %s" % change
137 stdout = util.popen(cmd, mode='rb')
155 stdout = util.popen(cmd, mode='rb')
General Comments 0
You need to be logged in to leave comments. Login now