diff --git a/hgext/largefiles/overrides.py b/hgext/largefiles/overrides.py --- a/hgext/largefiles/overrides.py +++ b/hgext/largefiles/overrides.py @@ -1005,23 +1005,19 @@ def getoutgoinglfiles(ui, repo, dest=Non lfutil.getlfilestoupload(repo, o, lambda fn, lfhash: toupload.add(fn)) return sorted(toupload) -def overrideoutgoing(orig, ui, repo, dest=None, **opts): - result = orig(ui, repo, dest, **opts) - +def outgoinghook(ui, repo, other, opts, missing): if opts.pop('large', None): - toupload = getoutgoinglfiles(ui, repo, dest, **opts) - if toupload is None: - ui.status(_('largefiles: No remote repo\n')) - elif not toupload: + toupload = set() + lfutil.getlfilestoupload(repo, missing, + lambda fn, lfhash: toupload.add(fn)) + if not toupload: ui.status(_('largefiles: no files to upload\n')) else: ui.status(_('largefiles to upload:\n')) - for file in toupload: + for file in sorted(toupload): ui.status(lfutil.splitstandin(file) + '\n') ui.status('\n') - return result - def summaryremotehook(ui, repo, opts, changes): largeopt = opts.get('large', False) if changes is None: diff --git a/hgext/largefiles/uisetup.py b/hgext/largefiles/uisetup.py --- a/hgext/largefiles/uisetup.py +++ b/hgext/largefiles/uisetup.py @@ -65,10 +65,11 @@ def uisetup(ui): debugstateopt = [('', 'large', None, _('display largefiles dirstate'))] entry[1].extend(debugstateopt) - entry = extensions.wrapcommand(commands.table, 'outgoing', - overrides.overrideoutgoing) + outgoing = lambda orgfunc, *arg, **kwargs: orgfunc(*arg, **kwargs) + entry = extensions.wrapcommand(commands.table, 'outgoing', outgoing) outgoingopt = [('', 'large', None, _('display outgoing largefiles'))] entry[1].extend(outgoingopt) + cmdutil.outgoinghooks.add('largefiles', overrides.outgoinghook) entry = extensions.wrapcommand(commands.table, 'summary', overrides.overridesummary) summaryopt = [('', 'large', None, _('display outgoing largefiles'))] diff --git a/tests/test-largefiles.t b/tests/test-largefiles.t --- a/tests/test-largefiles.t +++ b/tests/test-largefiles.t @@ -703,7 +703,6 @@ Test that outgoing --large works (with r date: Thu Jan 01 00:00:00 1970 +0000 summary: this used to not notice the rm - searching for changes largefiles to upload: foo large @@ -2154,10 +2153,15 @@ check messages when there is no files to comparing with $TESTTMP/issue3651/src (glob) searching for changes no changes found - searching for changes largefiles: no files to upload [1] + $ hg -R clone2 outgoing --large --graph --template "{rev}" + comparing with $TESTTMP/issue3651/src (glob) + searching for changes + no changes found + largefiles: no files to upload + check messages when there are files to upload: $ echo b > clone2/b @@ -2181,7 +2185,14 @@ check messages when there are files to u date: Thu Jan 01 00:00:00 1970 +0000 summary: #1 + largefiles to upload: + b + + $ hg -R clone2 outgoing --large --graph --template "{rev}" + comparing with $TESTTMP/issue3651/src searching for changes + @ 1 + largefiles to upload: b