##// END OF EJS Templates
largefiles: use progress helper...
Martin von Zweigbergk -
r38426:164306d3 default
parent child Browse files
Show More
@@ -62,9 +62,10 b' class basestore(object):'
62
62
63 at = 0
63 at = 0
64 available = self.exists(set(hash for (_filename, hash) in files))
64 available = self.exists(set(hash for (_filename, hash) in files))
65 progress = ui.makeprogress(_('getting largefiles'), unit=_('files'),
66 total=len(files))
65 for filename, hash in files:
67 for filename, hash in files:
66 ui.progress(_('getting largefiles'), at, unit=_('files'),
68 progress.update(at)
67 total=len(files))
68 at += 1
69 at += 1
69 ui.note(_('getting %s:%s\n') % (filename, hash))
70 ui.note(_('getting %s:%s\n') % (filename, hash))
70
71
@@ -79,7 +80,7 b' class basestore(object):'
79 else:
80 else:
80 missing.append(filename)
81 missing.append(filename)
81
82
82 ui.progress(_('getting largefiles'), None)
83 progress.complete()
83 return (success, missing)
84 return (success, missing)
84
85
85 def _gethash(self, filename, hash):
86 def _gethash(self, filename, hash):
@@ -118,12 +118,14 b' def lfconvert(ui, src, dest, *pats, **op'
118 matcher = None
118 matcher = None
119
119
120 lfiletohash = {}
120 lfiletohash = {}
121 progress = ui.makeprogress(_('converting revisions'),
122 unit=_('revisions'),
123 total=rsrc['tip'].rev())
121 for ctx in ctxs:
124 for ctx in ctxs:
122 ui.progress(_('converting revisions'), ctx.rev(),
125 progress.update(ctx.rev())
123 unit=_('revisions'), total=rsrc['tip'].rev())
124 _lfconvert_addchangeset(rsrc, rdst, ctx, revmap,
126 _lfconvert_addchangeset(rsrc, rdst, ctx, revmap,
125 lfiles, normalfiles, matcher, size, lfiletohash)
127 lfiles, normalfiles, matcher, size, lfiletohash)
126 ui.progress(_('converting revisions'), None)
128 progress.complete()
127
129
128 if rdst.wvfs.exists(lfutil.shortname):
130 if rdst.wvfs.exists(lfutil.shortname):
129 rdst.wvfs.rmtree(lfutil.shortname)
131 rdst.wvfs.rmtree(lfutil.shortname)
@@ -368,9 +370,10 b' def uploadlfiles(ui, rsrc, rdst, files):'
368 files = [h for h in files if not retval[h]]
370 files = [h for h in files if not retval[h]]
369 ui.debug("%d largefiles need to be uploaded\n" % len(files))
371 ui.debug("%d largefiles need to be uploaded\n" % len(files))
370
372
373 progress = ui.makeprogress(_('uploading largefiles'), unit=_('files'),
374 total=len(files))
371 for hash in files:
375 for hash in files:
372 ui.progress(_('uploading largefiles'), at, unit=_('files'),
376 progress.update(at)
373 total=len(files))
374 source = lfutil.findfile(rsrc, hash)
377 source = lfutil.findfile(rsrc, hash)
375 if not source:
378 if not source:
376 raise error.Abort(_('largefile %s missing from store'
379 raise error.Abort(_('largefile %s missing from store'
@@ -378,7 +381,7 b' def uploadlfiles(ui, rsrc, rdst, files):'
378 # XXX check for errors here
381 # XXX check for errors here
379 store.put(source, hash)
382 store.put(source, hash)
380 at += 1
383 at += 1
381 ui.progress(_('uploading largefiles'), None)
384 progress.complete()
382
385
383 def verifylfiles(ui, repo, all=False, contents=False):
386 def verifylfiles(ui, repo, all=False, contents=False):
384 '''Verify that every largefile revision in the current changeset
387 '''Verify that every largefile revision in the current changeset
@@ -501,9 +501,10 b' def getlfilestoupdate(oldstandins, newst'
501 return filelist
501 return filelist
502
502
503 def getlfilestoupload(repo, missing, addfunc):
503 def getlfilestoupload(repo, missing, addfunc):
504 progress = repo.ui.makeprogress(_('finding outgoing largefiles'),
505 unit=_('revisions'), total=len(missing))
504 for i, n in enumerate(missing):
506 for i, n in enumerate(missing):
505 repo.ui.progress(_('finding outgoing largefiles'), i,
507 progress.update(i)
506 unit=_('revisions'), total=len(missing))
507 parents = [p for p in repo[n].parents() if p != node.nullid]
508 parents = [p for p in repo[n].parents() if p != node.nullid]
508
509
509 oldlfstatus = repo.lfstatus
510 oldlfstatus = repo.lfstatus
@@ -530,7 +531,7 b' def getlfilestoupload(repo, missing, add'
530 for fn in files:
531 for fn in files:
531 if isstandin(fn) and fn in ctx:
532 if isstandin(fn) and fn in ctx:
532 addfunc(fn, readasstandin(ctx[fn]))
533 addfunc(fn, readasstandin(ctx[fn]))
533 repo.ui.progress(_('finding outgoing largefiles'), None)
534 progress.complete()
534
535
535 def updatestandinsbymatch(repo, match):
536 def updatestandinsbymatch(repo, match):
536 '''Update standins in the working directory according to specified match
537 '''Update standins in the working directory according to specified match
General Comments 0
You need to be logged in to leave comments. Login now