Show More
@@ -143,13 +143,11 b' class progresssource(object):' | |||||
143 | def __init__(self, ui, source, filecount): |
|
143 | def __init__(self, ui, source, filecount): | |
144 | self.ui = ui |
|
144 | self.ui = ui | |
145 | self.source = source |
|
145 | self.source = source | |
146 | self.filecount = filecount |
|
146 | self.progress = ui.makeprogress(_('getting files'), unit=_('files'), | |
147 | self.retrieved = 0 |
|
147 | total=filecount) | |
148 |
|
148 | |||
149 | def getfile(self, file, rev): |
|
149 | def getfile(self, file, rev): | |
150 | self.retrieved += 1 |
|
150 | self.progress.increment(item=file) | |
151 | self.ui.progress(_('getting files'), self.retrieved, |
|
|||
152 | item=file, total=self.filecount, unit=_('files')) |
|
|||
153 | return self.source.getfile(file, rev) |
|
151 | return self.source.getfile(file, rev) | |
154 |
|
152 | |||
155 | def targetfilebelongstosource(self, targetfilename): |
|
153 | def targetfilebelongstosource(self, targetfilename): | |
@@ -159,7 +157,7 b' class progresssource(object):' | |||||
159 | return self.source.lookuprev(rev) |
|
157 | return self.source.lookuprev(rev) | |
160 |
|
158 | |||
161 | def close(self): |
|
159 | def close(self): | |
162 |
self. |
|
160 | self.progress.complete() | |
163 |
|
161 | |||
164 | class converter(object): |
|
162 | class converter(object): | |
165 | def __init__(self, ui, source, dest, revmapfile, opts): |
|
163 | def __init__(self, ui, source, dest, revmapfile, opts): | |
@@ -238,6 +236,8 b' class converter(object):' | |||||
238 | known = set() |
|
236 | known = set() | |
239 | parents = {} |
|
237 | parents = {} | |
240 | numcommits = self.source.numcommits() |
|
238 | numcommits = self.source.numcommits() | |
|
239 | progress = self.ui.makeprogress(_('scanning'), unit=_('revisions'), | |||
|
240 | total=numcommits) | |||
241 | while visit: |
|
241 | while visit: | |
242 | n = visit.pop(0) |
|
242 | n = visit.pop(0) | |
243 | if n in known: |
|
243 | if n in known: | |
@@ -247,14 +247,13 b' class converter(object):' | |||||
247 | if m == SKIPREV or self.dest.hascommitfrommap(m): |
|
247 | if m == SKIPREV or self.dest.hascommitfrommap(m): | |
248 | continue |
|
248 | continue | |
249 | known.add(n) |
|
249 | known.add(n) | |
250 | self.ui.progress(_('scanning'), len(known), unit=_('revisions'), |
|
250 | progress.update(len(known)) | |
251 | total=numcommits) |
|
|||
252 | commit = self.cachecommit(n) |
|
251 | commit = self.cachecommit(n) | |
253 | parents[n] = [] |
|
252 | parents[n] = [] | |
254 | for p in commit.parents: |
|
253 | for p in commit.parents: | |
255 | parents[n].append(p) |
|
254 | parents[n].append(p) | |
256 | visit.append(p) |
|
255 | visit.append(p) | |
257 | self.ui.progress(_('scanning'), None) |
|
256 | progress.complete() | |
258 |
|
257 | |||
259 | return parents |
|
258 | return parents | |
260 |
|
259 | |||
@@ -510,6 +509,8 b' class converter(object):' | |||||
510 | c = None |
|
509 | c = None | |
511 |
|
510 | |||
512 | self.ui.status(_("converting...\n")) |
|
511 | self.ui.status(_("converting...\n")) | |
|
512 | progress = self.ui.makeprogress(_('converting'), | |||
|
513 | unit=_('revisions'), total=len(t)) | |||
513 | for i, c in enumerate(t): |
|
514 | for i, c in enumerate(t): | |
514 | num -= 1 |
|
515 | num -= 1 | |
515 | desc = self.commitcache[c].desc |
|
516 | desc = self.commitcache[c].desc | |
@@ -520,10 +521,9 b' class converter(object):' | |||||
520 | # uses is 'utf-8' |
|
521 | # uses is 'utf-8' | |
521 | self.ui.status("%d %s\n" % (num, recode(desc))) |
|
522 | self.ui.status("%d %s\n" % (num, recode(desc))) | |
522 | self.ui.note(_("source: %s\n") % recode(c)) |
|
523 | self.ui.note(_("source: %s\n") % recode(c)) | |
523 | self.ui.progress(_('converting'), i, unit=_('revisions'), |
|
524 | progress.update(i) | |
524 | total=len(t)) |
|
|||
525 | self.copy(c) |
|
525 | self.copy(c) | |
526 |
|
|
526 | progress.complete() | |
527 |
|
527 | |||
528 | if not self.ui.configbool('convert', 'skiptags'): |
|
528 | if not self.ui.configbool('convert', 'skiptags'): | |
529 | tags = self.source.gettags() |
|
529 | tags = self.source.gettags() |
@@ -750,9 +750,10 b' class svn_source(converter_source):' | |||||
750 | self.module = new_module |
|
750 | self.module = new_module | |
751 | self.reparent(self.module) |
|
751 | self.reparent(self.module) | |
752 |
|
752 | |||
|
753 | progress = self.ui.makeprogress(_('scanning paths'), unit=_('paths'), | |||
|
754 | total=len(paths)) | |||
753 | for i, (path, ent) in enumerate(paths): |
|
755 | for i, (path, ent) in enumerate(paths): | |
754 |
|
|
756 | progress.update(i, item=path) | |
755 | total=len(paths), unit=_('paths')) |
|
|||
756 | entrypath = self.getrelpath(path) |
|
757 | entrypath = self.getrelpath(path) | |
757 |
|
758 | |||
758 | kind = self._checkpath(entrypath, revnum) |
|
759 | kind = self._checkpath(entrypath, revnum) | |
@@ -838,7 +839,7 b' class svn_source(converter_source):' | |||||
838 | copytopath = self.getrelpath(copytopath) |
|
839 | copytopath = self.getrelpath(copytopath) | |
839 | copies[self.recode(copytopath)] = self.recode(childpath) |
|
840 | copies[self.recode(copytopath)] = self.recode(childpath) | |
840 |
|
841 | |||
841 | self.ui.progress(_('scanning paths'), None) |
|
842 | progress.complete() | |
842 | changed.update(removed) |
|
843 | changed.update(removed) | |
843 | return (list(changed), removed, copies) |
|
844 | return (list(changed), removed, copies) | |
844 |
|
845 |
General Comments 0
You need to be logged in to leave comments.
Login now