remote-hg: improve progress calculation
No need to manually keep track of the revision count. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
34d75e78f4
commit
63f54cf216
@ -415,7 +415,7 @@ def export_ref(repo, name, kind, head):
|
|||||||
tip = 0
|
tip = 0
|
||||||
|
|
||||||
revs = xrange(tip, head.rev() + 1)
|
revs = xrange(tip, head.rev() + 1)
|
||||||
count = 0
|
total = len(revs)
|
||||||
|
|
||||||
for rev in revs:
|
for rev in revs:
|
||||||
|
|
||||||
@ -423,7 +423,6 @@ def export_ref(repo, name, kind, head):
|
|||||||
node = c.node()
|
node = c.node()
|
||||||
|
|
||||||
if marks.is_marked(c.hex()):
|
if marks.is_marked(c.hex()):
|
||||||
count += 1
|
|
||||||
continue
|
continue
|
||||||
|
|
||||||
(manifest, user, (time, tz), files, desc, extra) = repo.changelog.read(node)
|
(manifest, user, (time, tz), files, desc, extra) = repo.changelog.read(node)
|
||||||
@ -495,9 +494,9 @@ def export_ref(repo, name, kind, head):
|
|||||||
print "D %s" % (fix_file_path(f))
|
print "D %s" % (fix_file_path(f))
|
||||||
print
|
print
|
||||||
|
|
||||||
count += 1
|
progress = (rev - tip)
|
||||||
if (count % 100 == 0):
|
if (progress % 100 == 0):
|
||||||
print "progress revision %d '%s' (%d/%d)" % (rev, name, count, len(revs))
|
print "progress revision %d '%s' (%d/%d)" % (rev, name, progress, total)
|
||||||
|
|
||||||
# make sure the ref is updated
|
# make sure the ref is updated
|
||||||
print "reset %s/%s" % (prefix, ename)
|
print "reset %s/%s" % (prefix, ename)
|
||||||
|
Loading…
Reference in New Issue
Block a user