63 fuzz=int(self.ui.config('convert', 'cvsps.fuzz', 60)), |
64 fuzz=int(self.ui.config('convert', 'cvsps.fuzz', 60)), |
64 mergeto=self.ui.config('convert', 'cvsps.mergeto', None), |
65 mergeto=self.ui.config('convert', 'cvsps.mergeto', None), |
65 mergefrom=self.ui.config('convert', 'cvsps.mergefrom', None)) |
66 mergefrom=self.ui.config('convert', 'cvsps.mergefrom', None)) |
66 |
67 |
67 for cs in db: |
68 for cs in db: |
68 if maxrev and cs.id>maxrev: |
69 if maxrev and cs.id > maxrev: |
69 break |
70 break |
70 id = str(cs.id) |
71 id = str(cs.id) |
71 cs.author = self.recode(cs.author) |
72 cs.author = self.recode(cs.author) |
72 self.lastbranch[cs.branch] = id |
73 self.lastbranch[cs.branch] = id |
73 cs.comment = self.recode(cs.comment) |
74 cs.comment = self.recode(cs.comment) |
74 date = util.datestr(cs.date) |
75 date = util.datestr(cs.date) |
75 self.tags.update(dict.fromkeys(cs.tags, id)) |
76 self.tags.update(dict.fromkeys(cs.tags, id)) |
76 |
77 |
77 files = {} |
78 files = {} |
78 for f in cs.entries: |
79 for f in cs.entries: |
79 files[f.file] = "%s%s" % ('.'.join([str(x) for x in f.revision]), |
80 files[f.file] = "%s%s" % ('.'.join([str(x) |
|
81 for x in f.revision]), |
80 ['', '(DEAD)'][f.dead]) |
82 ['', '(DEAD)'][f.dead]) |
81 |
83 |
82 # add current commit to set |
84 # add current commit to set |
83 c = commit(author=cs.author, date=date, |
85 c = commit(author=cs.author, date=date, |
84 parents=[str(p.id) for p in cs.parents], |
86 parents=[str(p.id) for p in cs.parents], |
184 " Merged Removed\n") |
186 " Merged Removed\n") |
185 self.writep.write("valid-requests\n") |
187 self.writep.write("valid-requests\n") |
186 self.writep.flush() |
188 self.writep.flush() |
187 r = self.readp.readline() |
189 r = self.readp.readline() |
188 if not r.startswith("Valid-requests"): |
190 if not r.startswith("Valid-requests"): |
189 raise util.Abort(_("unexpected response from CVS server " |
191 raise util.Abort(_('unexpected response from CVS server ' |
190 "(expected \"Valid-requests\", but got %r)") |
192 '(expected "Valid-requests", but got %r)') |
191 % r) |
193 % r) |
192 if "UseUnchanged" in r: |
194 if "UseUnchanged" in r: |
193 self.writep.write("UseUnchanged\n") |
195 self.writep.write("UseUnchanged\n") |
194 self.writep.flush() |
196 self.writep.flush() |
195 r = self.readp.readline() |
197 r = self.readp.readline() |