Show More
@@ -1022,6 +1022,30 b' def overrideoutgoing(orig, ui, repo, des' | |||||
1022 |
|
1022 | |||
1023 | return result |
|
1023 | return result | |
1024 |
|
1024 | |||
|
1025 | def summaryremotehook(ui, repo, opts, changes): | |||
|
1026 | largeopt = opts.get('large', False) | |||
|
1027 | if changes is None: | |||
|
1028 | if largeopt: | |||
|
1029 | return (False, True) # only outgoing check is needed | |||
|
1030 | else: | |||
|
1031 | return (False, False) | |||
|
1032 | elif largeopt: | |||
|
1033 | url, branch, peer, outgoing = changes[1] | |||
|
1034 | if peer is None: | |||
|
1035 | # i18n: column positioning for "hg summary" | |||
|
1036 | ui.status(_('largefiles: (no remote repo)\n')) | |||
|
1037 | return | |||
|
1038 | ||||
|
1039 | toupload = set() | |||
|
1040 | lfutil.getlfilestoupload(repo, outgoing.missing, | |||
|
1041 | lambda fn, lfhash: toupload.add(fn)) | |||
|
1042 | if not toupload: | |||
|
1043 | # i18n: column positioning for "hg summary" | |||
|
1044 | ui.status(_('largefiles: (no files to upload)\n')) | |||
|
1045 | else: | |||
|
1046 | # i18n: column positioning for "hg summary" | |||
|
1047 | ui.status(_('largefiles: %d to upload\n') % len(toupload)) | |||
|
1048 | ||||
1025 | def overridesummary(orig, ui, repo, *pats, **opts): |
|
1049 | def overridesummary(orig, ui, repo, *pats, **opts): | |
1026 | try: |
|
1050 | try: | |
1027 | repo.lfstatus = True |
|
1051 | repo.lfstatus = True | |
@@ -1029,18 +1053,6 b' def overridesummary(orig, ui, repo, *pat' | |||||
1029 | finally: |
|
1053 | finally: | |
1030 | repo.lfstatus = False |
|
1054 | repo.lfstatus = False | |
1031 |
|
1055 | |||
1032 | if opts.pop('large', None): |
|
|||
1033 | toupload = getoutgoinglfiles(ui, repo, None, **opts) |
|
|||
1034 | if toupload is None: |
|
|||
1035 | # i18n: column positioning for "hg summary" |
|
|||
1036 | ui.status(_('largefiles: (no remote repo)\n')) |
|
|||
1037 | elif not toupload: |
|
|||
1038 | # i18n: column positioning for "hg summary" |
|
|||
1039 | ui.status(_('largefiles: (no files to upload)\n')) |
|
|||
1040 | else: |
|
|||
1041 | # i18n: column positioning for "hg summary" |
|
|||
1042 | ui.status(_('largefiles: %d to upload\n') % len(toupload)) |
|
|||
1043 |
|
||||
1044 | def scmutiladdremove(orig, repo, pats=[], opts={}, dry_run=None, |
|
1056 | def scmutiladdremove(orig, repo, pats=[], opts={}, dry_run=None, | |
1045 | similarity=None): |
|
1057 | similarity=None): | |
1046 | if not lfutil.islfilesrepo(repo): |
|
1058 | if not lfutil.islfilesrepo(repo): |
@@ -73,6 +73,7 b' def uisetup(ui):' | |||||
73 | overrides.overridesummary) |
|
73 | overrides.overridesummary) | |
74 | summaryopt = [('', 'large', None, _('display outgoing largefiles'))] |
|
74 | summaryopt = [('', 'large', None, _('display outgoing largefiles'))] | |
75 | entry[1].extend(summaryopt) |
|
75 | entry[1].extend(summaryopt) | |
|
76 | cmdutil.summaryremotehooks.add('largefiles', overrides.summaryremotehook) | |||
76 |
|
77 | |||
77 | entry = extensions.wrapcommand(commands.table, 'update', |
|
78 | entry = extensions.wrapcommand(commands.table, 'update', | |
78 | overrides.overrideupdate) |
|
79 | overrides.overrideupdate) |
@@ -2149,7 +2149,6 b' check messages when there is no files to' | |||||
2149 | branch: default |
|
2149 | branch: default | |
2150 | commit: (clean) |
|
2150 | commit: (clean) | |
2151 | update: (current) |
|
2151 | update: (current) | |
2152 | searching for changes |
|
|||
2153 | largefiles: (no files to upload) |
|
2152 | largefiles: (no files to upload) | |
2154 | $ hg -R clone2 outgoing --large |
|
2153 | $ hg -R clone2 outgoing --large | |
2155 | comparing with $TESTTMP/issue3651/src (glob) |
|
2154 | comparing with $TESTTMP/issue3651/src (glob) | |
@@ -2172,7 +2171,6 b' check messages when there are files to u' | |||||
2172 | branch: default |
|
2171 | branch: default | |
2173 | commit: (clean) |
|
2172 | commit: (clean) | |
2174 | update: (current) |
|
2173 | update: (current) | |
2175 | searching for changes |
|
|||
2176 | largefiles: 1 to upload |
|
2174 | largefiles: 1 to upload | |
2177 | $ hg -R clone2 outgoing --large |
|
2175 | $ hg -R clone2 outgoing --large | |
2178 | comparing with $TESTTMP/issue3651/src (glob) |
|
2176 | comparing with $TESTTMP/issue3651/src (glob) |
General Comments 0
You need to be logged in to leave comments.
Login now