Commits

Dan Villiom Podlaski Christiansen  committed 446be7c

show progress output for pull

  • Participants
  • Parent commits 083ac81

Comments (0)

Files changed (1)

     tags = {}
 
     try:
-        for c in changes:
+        for i, c in enumerate(changes, start=1):
             ui.note(_('change %s\n') % c)
             cl = client.describe(c)
             files = client.fstat(c, all=bool(startrev))
 
+            if hasattr(ui, 'progress'):
+                ui.progress('pull', i,
+                            item=cl.change, unit='changelists',
+                            total=len(changes))
+
             if client.keep:
                 if startrev:
                     client.sync(c, all=True, force=True)
                                 abort=False)
                     client.sync(c, force=True, files=[f[0] for f in files])
 
+            if hasattr(ui, 'progress'):
+                ui.progress('pull', i,
+                            item=cl.change, unit='changelists',
+                            total=len(changes))
+
             nodes = client.parsenodes(cl.desc)
             if nodes:
                 parent = nodes[-1]
             ui.note(_('added changeset %d:%s\n') % (ctx.rev(), ctx))
 
     finally:
+        if hasattr(ui, 'progress'):
+            ui.progress('pull', None)
+
         if tags:
             p4rev, p4id = client.find()
             ctx = repo[p4rev]