diff --git a/hgext/largefiles/overrides.py b/hgext/largefiles/overrides.py --- a/hgext/largefiles/overrides.py +++ b/hgext/largefiles/overrides.py @@ -968,7 +968,7 @@ def getoutgoinglfiles(ui, repo, dest=Non return None o = lfutil.findoutgoing(repo, remote, False) if not o: - return None + return o o = repo.changelog.nodesbetween(o, revs)[0] if opts.get('newest_first'): o.reverse() @@ -1002,6 +1002,8 @@ def overrideoutgoing(orig, ui, repo, des toupload = getoutgoinglfiles(ui, repo, dest, **opts) if toupload is None: ui.status(_('largefiles: No remote repo\n')) + elif not toupload: + ui.status(_('largefiles: no files to upload\n')) else: ui.status(_('largefiles to upload:\n')) for file in toupload: @@ -1021,6 +1023,8 @@ def overridesummary(orig, ui, repo, *pat toupload = getoutgoinglfiles(ui, repo, None, **opts) if toupload is None: ui.status(_('largefiles: No remote repo\n')) + elif not toupload: + ui.status(_('largefiles: (no files to upload)\n')) else: ui.status(_('largefiles: %d to upload\n') % len(toupload)) diff --git a/tests/test-largefiles.t b/tests/test-largefiles.t --- a/tests/test-largefiles.t +++ b/tests/test-largefiles.t @@ -1627,3 +1627,87 @@ Test commit's addremove option prior to .hglf/large2.dat $ cd .. + +issue3651: summary/outgoing with largefiles shows "no remote repo" +unexpectedly + + $ mkdir issue3651 + $ cd issue3651 + + $ hg init src + $ echo a > src/a + $ hg -R src add --large src/a + $ hg -R src commit -m '#0' + Invoking status precommit hook + A a + +check messages when no remote repository is specified: +"no remote repo" route for "hg outgoing --large" is not tested here, +because it can't be reproduced easily. + + $ hg init clone1 + $ hg -R clone1 -q pull src + $ hg -R clone1 -q update + $ hg -R clone1 paths | grep default + [1] + + $ hg -R clone1 summary --large + parent: 0:fc0bd45326d3 tip + #0 + branch: default + commit: (clean) + update: (current) + largefiles: No remote repo + +check messages when there is no files to upload: + + $ hg -q clone src clone2 + $ hg -R clone2 paths | grep default + default = $TESTTMP/issue3651/src + + $ hg -R clone2 summary --large + parent: 0:fc0bd45326d3 tip + #0 + branch: default + commit: (clean) + update: (current) + searching for changes + largefiles: (no files to upload) + $ hg -R clone2 outgoing --large + comparing with $TESTTMP/issue3651/src + searching for changes + no changes found + searching for changes + largefiles: no files to upload + [1] + +check messages when there are files to upload: + + $ echo b > clone2/b + $ hg -R clone2 add --large clone2/b + $ hg -R clone2 commit -m '#1' + Invoking status precommit hook + A b + $ hg -R clone2 summary --large + parent: 1:1acbe71ce432 tip + #1 + branch: default + commit: (clean) + update: (current) + searching for changes + largefiles: 1 to upload + $ hg -R clone2 outgoing --large + comparing with $TESTTMP/issue3651/src + searching for changes + changeset: 1:1acbe71ce432 + tag: tip + user: test + date: Thu Jan 01 00:00:00 1970 +0000 + summary: #1 + + searching for changes + largefiles to upload: + b + + + $ cd ..