Comments
Patch
@@ -1018,6 +1018,27 @@
return result
+def summaryremotehook(ui, repo, opts, changes):
+ largeopt = opts.get('large', False)
+ if changes is None:
+ if largeopt:
+ return (False, True) # only outgoing check is needed
+ else:
+ return (False, False)
+ elif largeopt:
+ url, branch, peer, outgoing = changes[1]
+ if peer is None:
+ # i18n: column positioning for "hg summary"
+ ui.status(_('largefiles: (no remote repo)\n'))
+ return
+ toupload = lfutil.getlfilestoupload(repo, outgoing.missing)
+ if not toupload:
+ # i18n: column positioning for "hg summary"
+ ui.status(_('largefiles: (no files to upload)\n'))
+ else:
+ # i18n: column positioning for "hg summary"
+ ui.status(_('largefiles: %d to upload\n') % len(toupload))
+
def overridesummary(orig, ui, repo, *pats, **opts):
try:
repo.lfstatus = True
@@ -1025,18 +1046,6 @@
finally:
repo.lfstatus = False
- if opts.pop('large', None):
- toupload = getoutgoinglfiles(ui, repo, None, **opts)
- if toupload is None:
- # i18n: column positioning for "hg summary"
- ui.status(_('largefiles: (no remote repo)\n'))
- elif not toupload:
- # i18n: column positioning for "hg summary"
- ui.status(_('largefiles: (no files to upload)\n'))
- else:
- # i18n: column positioning for "hg summary"
- ui.status(_('largefiles: %d to upload\n') % len(toupload))
-
def scmutiladdremove(orig, repo, pats=[], opts={}, dry_run=None,
similarity=None):
if not lfutil.islfilesrepo(repo):
@@ -73,6 +73,7 @@
overrides.overridesummary)
summaryopt = [('', 'large', None, _('display outgoing largefiles'))]
entry[1].extend(summaryopt)
+ cmdutil.summaryremotehooks.add('largefiles', overrides.summaryremotehook)
entry = extensions.wrapcommand(commands.table, 'update',
overrides.overrideupdate)
@@ -2149,7 +2149,6 @@
branch: default
commit: (clean)
update: (current)
- searching for changes
largefiles: (no files to upload)
$ hg -R clone2 outgoing --large
comparing with $TESTTMP/issue3651/src (glob)
@@ -2172,7 +2171,6 @@
branch: default
commit: (clean)
update: (current)
- searching for changes
largefiles: 1 to upload
$ hg -R clone2 outgoing --large
comparing with $TESTTMP/issue3651/src (glob)