diff --git a/hgext/largefiles/overrides.py b/hgext/largefiles/overrides.py --- a/hgext/largefiles/overrides.py +++ b/hgext/largefiles/overrides.py @@ -1009,15 +1009,34 @@ def _getoutgoings(repo, missing, addfunc def outgoinghook(ui, repo, other, opts, missing): if opts.pop('large', None): - toupload = set() - lfutil.getlfilestoupload(repo, missing, - lambda fn, lfhash: toupload.add(fn)) + lfhashes = set() + if ui.debugflag: + toupload = {} + def addfunc(fn, lfhash): + if fn not in toupload: + toupload[fn] = [] + toupload[fn].append(lfhash) + lfhashes.add(lfhash) + def showhashes(fn): + for lfhash in sorted(toupload[fn]): + ui.debug(' %s\n' % (lfhash)) + else: + toupload = set() + def addfunc(fn, lfhash): + toupload.add(fn) + lfhashes.add(lfhash) + def showhashes(fn): + pass + _getoutgoings(repo, missing, addfunc) + if not toupload: ui.status(_('largefiles: no files to upload\n')) else: - ui.status(_('largefiles to upload:\n')) + ui.status(_('largefiles to upload (%d entities):\n') + % (len(lfhashes))) for file in sorted(toupload): ui.status(lfutil.splitstandin(file) + '\n') + showhashes(file) ui.status('\n') def summaryremotehook(ui, repo, opts, changes): diff --git a/tests/test-largefiles-misc.t b/tests/test-largefiles-misc.t --- a/tests/test-largefiles-misc.t +++ b/tests/test-largefiles-misc.t @@ -478,7 +478,7 @@ check messages when there are files to u date: Thu Jan 01 00:00:00 1970 +0000 summary: #1 - largefiles to upload: + largefiles to upload (1 entities): b $ hg -R clone2 outgoing --large --graph --template "{rev}" @@ -486,7 +486,7 @@ check messages when there are files to u searching for changes @ 1 - largefiles to upload: + largefiles to upload (1 entities): b @@ -509,11 +509,28 @@ check messages when there are files to u searching for changes 1:1acbe71ce432 2:6095d0695d70 - largefiles to upload: + largefiles to upload (1 entities): b b1 b2 + $ hg -R clone2 cat -r 1 clone2/.hglf/b + 89e6c98d92887913cadf06b2adb97f26cde4849b + $ hg -R clone2 outgoing --large -T "{rev}:{node|short}\n" --debug + comparing with $TESTTMP/issue3651/src (glob) + query 1; heads + searching for changes + all remote heads known locally + 1:1acbe71ce432 + 2:6095d0695d70 + largefiles to upload (1 entities): + b + 89e6c98d92887913cadf06b2adb97f26cde4849b + b1 + 89e6c98d92887913cadf06b2adb97f26cde4849b + b2 + 89e6c98d92887913cadf06b2adb97f26cde4849b + $ echo bbb > clone2/b $ hg -R clone2 commit -m '#3: add new largefile entity as existing file' @@ -542,11 +559,35 @@ check messages when there are files to u 3:7983dce246cc 4:233f12ada4ae 5:036794ea641c - largefiles to upload: + largefiles to upload (3 entities): b b1 b2 + $ hg -R clone2 cat -r 3 clone2/.hglf/b + c801c9cfe94400963fcb683246217d5db77f9a9a + $ hg -R clone2 cat -r 4 clone2/.hglf/b + 13f9ed0898e315bf59dc2973fec52037b6f441a2 + $ hg -R clone2 outgoing --large -T "{rev}:{node|short}\n" --debug + comparing with $TESTTMP/issue3651/src (glob) + query 1; heads + searching for changes + all remote heads known locally + 1:1acbe71ce432 + 2:6095d0695d70 + 3:7983dce246cc + 4:233f12ada4ae + 5:036794ea641c + largefiles to upload (3 entities): + b + 13f9ed0898e315bf59dc2973fec52037b6f441a2 + 89e6c98d92887913cadf06b2adb97f26cde4849b + c801c9cfe94400963fcb683246217d5db77f9a9a + b1 + 89e6c98d92887913cadf06b2adb97f26cde4849b + b2 + 89e6c98d92887913cadf06b2adb97f26cde4849b + $ cd .. diff --git a/tests/test-largefiles.t b/tests/test-largefiles.t --- a/tests/test-largefiles.t +++ b/tests/test-largefiles.t @@ -680,7 +680,7 @@ Test that outgoing --large works (with r date: Thu Jan 01 00:00:00 1970 +0000 summary: this used to not notice the rm - largefiles to upload: + largefiles to upload (2 entities): foo large large8