Show More
@@ -992,20 +992,28 b' def overrideforget(orig, ui, repo, *pats' | |||||
992 |
|
992 | |||
993 | return result |
|
993 | return result | |
994 |
|
994 | |||
995 | def _getoutgoings(repo, missing, addfunc): |
|
995 | def _getoutgoings(repo, other, missing, addfunc): | |
996 | """get pairs of filename and largefile hash in outgoing revisions |
|
996 | """get pairs of filename and largefile hash in outgoing revisions | |
997 | in 'missing'. |
|
997 | in 'missing'. | |
998 |
|
998 | |||
|
999 | largefiles already existing on 'other' repository are ignored. | |||
|
1000 | ||||
999 | 'addfunc' is invoked with each unique pairs of filename and |
|
1001 | 'addfunc' is invoked with each unique pairs of filename and | |
1000 | largefile hash value. |
|
1002 | largefile hash value. | |
1001 | """ |
|
1003 | """ | |
1002 | knowns = set() |
|
1004 | knowns = set() | |
|
1005 | lfhashes = set() | |||
1003 | def dedup(fn, lfhash): |
|
1006 | def dedup(fn, lfhash): | |
1004 | k = (fn, lfhash) |
|
1007 | k = (fn, lfhash) | |
1005 | if k not in knowns: |
|
1008 | if k not in knowns: | |
1006 | knowns.add(k) |
|
1009 | knowns.add(k) | |
1007 |
add |
|
1010 | lfhashes.add(lfhash) | |
1008 | lfutil.getlfilestoupload(repo, missing, dedup) |
|
1011 | lfutil.getlfilestoupload(repo, missing, dedup) | |
|
1012 | if lfhashes: | |||
|
1013 | lfexists = basestore._openstore(repo, other).exists(lfhashes) | |||
|
1014 | for fn, lfhash in knowns: | |||
|
1015 | if not lfexists[lfhash]: # lfhash doesn't exist on "other" | |||
|
1016 | addfunc(fn, lfhash) | |||
1009 |
|
1017 | |||
1010 | def outgoinghook(ui, repo, other, opts, missing): |
|
1018 | def outgoinghook(ui, repo, other, opts, missing): | |
1011 | if opts.pop('large', None): |
|
1019 | if opts.pop('large', None): | |
@@ -1027,7 +1035,7 b' def outgoinghook(ui, repo, other, opts, ' | |||||
1027 | lfhashes.add(lfhash) |
|
1035 | lfhashes.add(lfhash) | |
1028 | def showhashes(fn): |
|
1036 | def showhashes(fn): | |
1029 | pass |
|
1037 | pass | |
1030 | _getoutgoings(repo, missing, addfunc) |
|
1038 | _getoutgoings(repo, other, missing, addfunc) | |
1031 |
|
1039 | |||
1032 | if not toupload: |
|
1040 | if not toupload: | |
1033 | ui.status(_('largefiles: no files to upload\n')) |
|
1041 | ui.status(_('largefiles: no files to upload\n')) | |
@@ -1058,7 +1066,7 b' def summaryremotehook(ui, repo, opts, ch' | |||||
1058 | def addfunc(fn, lfhash): |
|
1066 | def addfunc(fn, lfhash): | |
1059 | toupload.add(fn) |
|
1067 | toupload.add(fn) | |
1060 | lfhashes.add(lfhash) |
|
1068 | lfhashes.add(lfhash) | |
1061 | _getoutgoings(repo, outgoing.missing, addfunc) |
|
1069 | _getoutgoings(repo, peer, outgoing.missing, addfunc) | |
1062 |
|
1070 | |||
1063 | if not toupload: |
|
1071 | if not toupload: | |
1064 | # i18n: column positioning for "hg summary" |
|
1072 | # i18n: column positioning for "hg summary" |
@@ -589,6 +589,46 b' check messages when there are files to u' | |||||
589 | 89e6c98d92887913cadf06b2adb97f26cde4849b |
|
589 | 89e6c98d92887913cadf06b2adb97f26cde4849b | |
590 |
|
590 | |||
591 |
|
591 | |||
|
592 | Pusing revision #1 causes uploading entity 89e6c98d9288, which is | |||
|
593 | shared also by largefiles b1, b2 in revision #2 and b in revision #5. | |||
|
594 | ||||
|
595 | Then, entity 89e6c98d9288 is not treated as "outgoing entity" at "hg | |||
|
596 | summary" and "hg outgoing", even though files in outgoing revision #2 | |||
|
597 | and #5 refer it. | |||
|
598 | ||||
|
599 | $ hg -R clone2 push -r 1 -q | |||
|
600 | $ hg -R clone2 summary --large | |||
|
601 | parent: 5:036794ea641c tip | |||
|
602 | #5: refer existing largefile entity again | |||
|
603 | branch: default | |||
|
604 | commit: (clean) | |||
|
605 | update: (current) | |||
|
606 | largefiles: 2 entities for 1 files to upload | |||
|
607 | $ hg -R clone2 outgoing --large -T "{rev}:{node|short}\n" | |||
|
608 | comparing with $TESTTMP/issue3651/src (glob) | |||
|
609 | searching for changes | |||
|
610 | 2:6095d0695d70 | |||
|
611 | 3:7983dce246cc | |||
|
612 | 4:233f12ada4ae | |||
|
613 | 5:036794ea641c | |||
|
614 | largefiles to upload (2 entities): | |||
|
615 | b | |||
|
616 | ||||
|
617 | $ hg -R clone2 outgoing --large -T "{rev}:{node|short}\n" --debug | |||
|
618 | comparing with $TESTTMP/issue3651/src (glob) | |||
|
619 | query 1; heads | |||
|
620 | searching for changes | |||
|
621 | all remote heads known locally | |||
|
622 | 2:6095d0695d70 | |||
|
623 | 3:7983dce246cc | |||
|
624 | 4:233f12ada4ae | |||
|
625 | 5:036794ea641c | |||
|
626 | largefiles to upload (2 entities): | |||
|
627 | b | |||
|
628 | 13f9ed0898e315bf59dc2973fec52037b6f441a2 | |||
|
629 | c801c9cfe94400963fcb683246217d5db77f9a9a | |||
|
630 | ||||
|
631 | ||||
592 | $ cd .. |
|
632 | $ cd .. | |
593 |
|
633 | |||
594 | merge action 'd' for 'local renamed directory to d2/g' which has no filename |
|
634 | merge action 'd' for 'local renamed directory to d2/g' which has no filename |
@@ -680,9 +680,7 b' Test that outgoing --large works (with r' | |||||
680 | date: Thu Jan 01 00:00:00 1970 +0000 |
|
680 | date: Thu Jan 01 00:00:00 1970 +0000 | |
681 | summary: this used to not notice the rm |
|
681 | summary: this used to not notice the rm | |
682 |
|
682 | |||
683 |
largefiles to upload ( |
|
683 | largefiles to upload (1 entities): | |
684 | foo |
|
|||
685 | large |
|
|||
686 | large8 |
|
684 | large8 | |
687 |
|
685 | |||
688 | $ cd ../a |
|
686 | $ cd ../a |
General Comments 0
You need to be logged in to leave comments.
Login now