Show More
@@ -267,6 +267,11 b' def overridelog(orig, ui, repo, *pats, *' | |||
|
267 | 267 | matchandpats = oldmatchandpats(ctx, pats, opts, globbed, default) |
|
268 | 268 | m, p = copy.copy(matchandpats) |
|
269 | 269 | |
|
270 | if m.always(): | |
|
271 | # We want to match everything anyway, so there's no benefit trying | |
|
272 | # to add standins. | |
|
273 | return matchandpats | |
|
274 | ||
|
270 | 275 | pats = set(p) |
|
271 | 276 | # TODO: handling of patterns in both cases below |
|
272 | 277 | if m._cwd: |
@@ -299,13 +304,25 b' def overridelog(orig, ui, repo, *pats, *' | |||
|
299 | 304 | |
|
300 | 305 | return m, pats |
|
301 | 306 | |
|
307 | # For hg log --patch, the match object is used in two different senses: | |
|
308 | # (1) to determine what revisions should be printed out, and | |
|
309 | # (2) to determine what files to print out diffs for. | |
|
310 | # The magic matchandpats override should be used for case (1) but not for | |
|
311 | # case (2). | |
|
312 | def overridemakelogfilematcher(repo, pats, opts): | |
|
313 | pctx = repo[None] | |
|
314 | match, pats = oldmatchandpats(pctx, pats, opts) | |
|
315 | return lambda rev: match | |
|
316 | ||
|
302 | 317 | oldmatchandpats = installmatchandpatsfn(overridematchandpats) |
|
318 | oldmakelogfilematcher = cmdutil._makenofollowlogfilematcher | |
|
319 | setattr(cmdutil, '_makenofollowlogfilematcher', overridemakelogfilematcher) | |
|
320 | ||
|
303 | 321 | try: |
|
304 | repo.lfstatus = True | |
|
305 | 322 | return orig(ui, repo, *pats, **opts) |
|
306 | 323 | finally: |
|
307 | repo.lfstatus = False | |
|
308 | 324 | restorematchandpatsfn() |
|
325 | setattr(cmdutil, '_makenofollowlogfilematcher', oldmakelogfilematcher) | |
|
309 | 326 | |
|
310 | 327 | def overrideverify(orig, ui, repo, *pats, **opts): |
|
311 | 328 | large = opts.pop('large', False) |
@@ -1500,7 +1500,7 b' def walkchangerevs(repo, match, opts, pr' | |||
|
1500 | 1500 | |
|
1501 | 1501 | return iterate() |
|
1502 | 1502 | |
|
1503 | def _makelogfilematcher(repo, files, followfirst): | |
|
1503 | def _makefollowlogfilematcher(repo, files, followfirst): | |
|
1504 | 1504 | # When displaying a revision with --patch --follow FILE, we have |
|
1505 | 1505 | # to know which file of the revision must be diffed. With |
|
1506 | 1506 | # --follow, we want the names of the ancestors of FILE in the |
@@ -1527,6 +1527,10 b' def _makelogfilematcher(repo, files, fol' | |||
|
1527 | 1527 | |
|
1528 | 1528 | return filematcher |
|
1529 | 1529 | |
|
1530 | def _makenofollowlogfilematcher(repo, pats, opts): | |
|
1531 | '''hook for extensions to override the filematcher for non-follow cases''' | |
|
1532 | return None | |
|
1533 | ||
|
1530 | 1534 | def _makelogrevset(repo, pats, opts, revs): |
|
1531 | 1535 | """Return (expr, filematcher) where expr is a revset string built |
|
1532 | 1536 | from log options and file patterns or None. If --stat or --patch |
@@ -1646,8 +1650,11 b' def _makelogrevset(repo, pats, opts, rev' | |||
|
1646 | 1650 | if follow and not match.always() and not slowpath: |
|
1647 | 1651 | # _makelogfilematcher expects its files argument to be relative to |
|
1648 | 1652 | # the repo root, so use match.files(), not pats. |
|
1649 |
filematcher = _makelogfilematcher(repo, match.files(), |
|
|
1653 | filematcher = _makefollowlogfilematcher(repo, match.files(), | |
|
1654 | followfirst) | |
|
1650 | 1655 | else: |
|
1656 | filematcher = _makenofollowlogfilematcher(repo, pats, opts) | |
|
1657 | if filematcher is None: | |
|
1651 | 1658 | filematcher = lambda rev: match |
|
1652 | 1659 | |
|
1653 | 1660 | expr = [] |
@@ -724,6 +724,197 b' Test graph log' | |||
|
724 | 724 | | |
|
725 | 725 | o 0:30d30fe6a5be add files |
|
726 | 726 | |
|
727 | ||
|
728 | Test log with --patch | |
|
729 | ||
|
730 | $ hg log --patch -r 6::7 | |
|
731 | changeset: 6:4355d653f84f | |
|
732 | user: test | |
|
733 | date: Thu Jan 01 00:00:00 1970 +0000 | |
|
734 | summary: edit files yet again | |
|
735 | ||
|
736 | diff -r 9d5af5072dbd -r 4355d653f84f .hglf/large3 | |
|
737 | --- a/.hglf/large3 Thu Jan 01 00:00:00 1970 +0000 | |
|
738 | +++ b/.hglf/large3 Thu Jan 01 00:00:00 1970 +0000 | |
|
739 | @@ -1,1 +1,1 @@ | |
|
740 | -baaf12afde9d8d67f25dab6dced0d2bf77dba47c | |
|
741 | +7838695e10da2bb75ac1156565f40a2595fa2fa0 | |
|
742 | diff -r 9d5af5072dbd -r 4355d653f84f .hglf/sub/large4 | |
|
743 | --- a/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000 | |
|
744 | +++ b/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000 | |
|
745 | @@ -1,1 +1,1 @@ | |
|
746 | -aeb2210d19f02886dde00dac279729a48471e2f9 | |
|
747 | +971fb41e78fea4f8e0ba5244784239371cb00591 | |
|
748 | diff -r 9d5af5072dbd -r 4355d653f84f normal3 | |
|
749 | --- a/normal3 Thu Jan 01 00:00:00 1970 +0000 | |
|
750 | +++ b/normal3 Thu Jan 01 00:00:00 1970 +0000 | |
|
751 | @@ -1,1 +1,1 @@ | |
|
752 | -normal3 | |
|
753 | +normal33 | |
|
754 | diff -r 9d5af5072dbd -r 4355d653f84f sub/normal4 | |
|
755 | --- a/sub/normal4 Thu Jan 01 00:00:00 1970 +0000 | |
|
756 | +++ b/sub/normal4 Thu Jan 01 00:00:00 1970 +0000 | |
|
757 | @@ -1,1 +1,1 @@ | |
|
758 | -normal4 | |
|
759 | +normal44 | |
|
760 | ||
|
761 | changeset: 7:daea875e9014 | |
|
762 | tag: tip | |
|
763 | user: test | |
|
764 | date: Thu Jan 01 00:00:00 1970 +0000 | |
|
765 | summary: add/edit more largefiles | |
|
766 | ||
|
767 | diff -r 4355d653f84f -r daea875e9014 .hglf/large3 | |
|
768 | --- a/.hglf/large3 Thu Jan 01 00:00:00 1970 +0000 | |
|
769 | +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 | |
|
770 | @@ -1,1 +0,0 @@ | |
|
771 | -7838695e10da2bb75ac1156565f40a2595fa2fa0 | |
|
772 | diff -r 4355d653f84f -r daea875e9014 .hglf/sub2/large6 | |
|
773 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 | |
|
774 | +++ b/.hglf/sub2/large6 Thu Jan 01 00:00:00 1970 +0000 | |
|
775 | @@ -0,0 +1,1 @@ | |
|
776 | +0d6d75887db61b2c7e6c74b5dd8fc6ad50c0cc30 | |
|
777 | diff -r 4355d653f84f -r daea875e9014 .hglf/sub2/large7 | |
|
778 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 | |
|
779 | +++ b/.hglf/sub2/large7 Thu Jan 01 00:00:00 1970 +0000 | |
|
780 | @@ -0,0 +1,1 @@ | |
|
781 | +bb3151689acb10f0c3125c560d5e63df914bc1af | |
|
782 | ||
|
783 | ||
|
784 | $ hg log --patch -r 6::7 sub/ | |
|
785 | changeset: 6:4355d653f84f | |
|
786 | user: test | |
|
787 | date: Thu Jan 01 00:00:00 1970 +0000 | |
|
788 | summary: edit files yet again | |
|
789 | ||
|
790 | diff -r 9d5af5072dbd -r 4355d653f84f .hglf/sub/large4 | |
|
791 | --- a/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000 | |
|
792 | +++ b/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000 | |
|
793 | @@ -1,1 +1,1 @@ | |
|
794 | -aeb2210d19f02886dde00dac279729a48471e2f9 | |
|
795 | +971fb41e78fea4f8e0ba5244784239371cb00591 | |
|
796 | diff -r 9d5af5072dbd -r 4355d653f84f sub/normal4 | |
|
797 | --- a/sub/normal4 Thu Jan 01 00:00:00 1970 +0000 | |
|
798 | +++ b/sub/normal4 Thu Jan 01 00:00:00 1970 +0000 | |
|
799 | @@ -1,1 +1,1 @@ | |
|
800 | -normal4 | |
|
801 | +normal44 | |
|
802 | ||
|
803 | ||
|
804 | log with both --follow and --patch | |
|
805 | ||
|
806 | $ hg log --follow --patch --limit 2 | |
|
807 | changeset: 7:daea875e9014 | |
|
808 | tag: tip | |
|
809 | user: test | |
|
810 | date: Thu Jan 01 00:00:00 1970 +0000 | |
|
811 | summary: add/edit more largefiles | |
|
812 | ||
|
813 | diff -r 4355d653f84f -r daea875e9014 .hglf/large3 | |
|
814 | --- a/.hglf/large3 Thu Jan 01 00:00:00 1970 +0000 | |
|
815 | +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 | |
|
816 | @@ -1,1 +0,0 @@ | |
|
817 | -7838695e10da2bb75ac1156565f40a2595fa2fa0 | |
|
818 | diff -r 4355d653f84f -r daea875e9014 .hglf/sub2/large6 | |
|
819 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 | |
|
820 | +++ b/.hglf/sub2/large6 Thu Jan 01 00:00:00 1970 +0000 | |
|
821 | @@ -0,0 +1,1 @@ | |
|
822 | +0d6d75887db61b2c7e6c74b5dd8fc6ad50c0cc30 | |
|
823 | diff -r 4355d653f84f -r daea875e9014 .hglf/sub2/large7 | |
|
824 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 | |
|
825 | +++ b/.hglf/sub2/large7 Thu Jan 01 00:00:00 1970 +0000 | |
|
826 | @@ -0,0 +1,1 @@ | |
|
827 | +bb3151689acb10f0c3125c560d5e63df914bc1af | |
|
828 | ||
|
829 | changeset: 6:4355d653f84f | |
|
830 | user: test | |
|
831 | date: Thu Jan 01 00:00:00 1970 +0000 | |
|
832 | summary: edit files yet again | |
|
833 | ||
|
834 | diff -r 9d5af5072dbd -r 4355d653f84f .hglf/large3 | |
|
835 | --- a/.hglf/large3 Thu Jan 01 00:00:00 1970 +0000 | |
|
836 | +++ b/.hglf/large3 Thu Jan 01 00:00:00 1970 +0000 | |
|
837 | @@ -1,1 +1,1 @@ | |
|
838 | -baaf12afde9d8d67f25dab6dced0d2bf77dba47c | |
|
839 | +7838695e10da2bb75ac1156565f40a2595fa2fa0 | |
|
840 | diff -r 9d5af5072dbd -r 4355d653f84f .hglf/sub/large4 | |
|
841 | --- a/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000 | |
|
842 | +++ b/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000 | |
|
843 | @@ -1,1 +1,1 @@ | |
|
844 | -aeb2210d19f02886dde00dac279729a48471e2f9 | |
|
845 | +971fb41e78fea4f8e0ba5244784239371cb00591 | |
|
846 | diff -r 9d5af5072dbd -r 4355d653f84f normal3 | |
|
847 | --- a/normal3 Thu Jan 01 00:00:00 1970 +0000 | |
|
848 | +++ b/normal3 Thu Jan 01 00:00:00 1970 +0000 | |
|
849 | @@ -1,1 +1,1 @@ | |
|
850 | -normal3 | |
|
851 | +normal33 | |
|
852 | diff -r 9d5af5072dbd -r 4355d653f84f sub/normal4 | |
|
853 | --- a/sub/normal4 Thu Jan 01 00:00:00 1970 +0000 | |
|
854 | +++ b/sub/normal4 Thu Jan 01 00:00:00 1970 +0000 | |
|
855 | @@ -1,1 +1,1 @@ | |
|
856 | -normal4 | |
|
857 | +normal44 | |
|
858 | ||
|
859 | $ hg log --follow --patch sub/large4 | |
|
860 | changeset: 6:4355d653f84f | |
|
861 | user: test | |
|
862 | date: Thu Jan 01 00:00:00 1970 +0000 | |
|
863 | summary: edit files yet again | |
|
864 | ||
|
865 | diff -r 9d5af5072dbd -r 4355d653f84f .hglf/sub/large4 | |
|
866 | --- a/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000 | |
|
867 | +++ b/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000 | |
|
868 | @@ -1,1 +1,1 @@ | |
|
869 | -aeb2210d19f02886dde00dac279729a48471e2f9 | |
|
870 | +971fb41e78fea4f8e0ba5244784239371cb00591 | |
|
871 | ||
|
872 | changeset: 5:9d5af5072dbd | |
|
873 | user: test | |
|
874 | date: Thu Jan 01 00:00:00 1970 +0000 | |
|
875 | summary: edit files again | |
|
876 | ||
|
877 | diff -r 74c02385b94c -r 9d5af5072dbd .hglf/sub/large4 | |
|
878 | --- a/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000 | |
|
879 | +++ b/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000 | |
|
880 | @@ -1,1 +1,1 @@ | |
|
881 | -eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 | |
|
882 | +aeb2210d19f02886dde00dac279729a48471e2f9 | |
|
883 | ||
|
884 | changeset: 4:74c02385b94c | |
|
885 | user: test | |
|
886 | date: Thu Jan 01 00:00:00 1970 +0000 | |
|
887 | summary: move files | |
|
888 | ||
|
889 | diff -r 9e8fbc4bce62 -r 74c02385b94c .hglf/sub/large4 | |
|
890 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 | |
|
891 | +++ b/.hglf/sub/large4 Thu Jan 01 00:00:00 1970 +0000 | |
|
892 | @@ -0,0 +1,1 @@ | |
|
893 | +eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 | |
|
894 | ||
|
895 | changeset: 1:ce8896473775 | |
|
896 | user: test | |
|
897 | date: Thu Jan 01 00:00:00 1970 +0000 | |
|
898 | summary: edit files | |
|
899 | ||
|
900 | diff -r 30d30fe6a5be -r ce8896473775 .hglf/sub/large2 | |
|
901 | --- a/.hglf/sub/large2 Thu Jan 01 00:00:00 1970 +0000 | |
|
902 | +++ b/.hglf/sub/large2 Thu Jan 01 00:00:00 1970 +0000 | |
|
903 | @@ -1,1 +1,1 @@ | |
|
904 | -1deebade43c8c498a3c8daddac0244dc55d1331d | |
|
905 | +eb7338044dc27f9bc59b8dd5a246b065ead7a9c4 | |
|
906 | ||
|
907 | changeset: 0:30d30fe6a5be | |
|
908 | user: test | |
|
909 | date: Thu Jan 01 00:00:00 1970 +0000 | |
|
910 | summary: add files | |
|
911 | ||
|
912 | diff -r 000000000000 -r 30d30fe6a5be .hglf/sub/large2 | |
|
913 | --- /dev/null Thu Jan 01 00:00:00 1970 +0000 | |
|
914 | +++ b/.hglf/sub/large2 Thu Jan 01 00:00:00 1970 +0000 | |
|
915 | @@ -0,0 +1,1 @@ | |
|
916 | +1deebade43c8c498a3c8daddac0244dc55d1331d | |
|
917 | ||
|
727 | 918 | $ cat sub/normal4 |
|
728 | 919 | normal44 |
|
729 | 920 | $ cat sub/large4 |
@@ -33,8 +33,8 b' failing test' | |||
|
33 | 33 | |
|
34 | 34 | $ $TESTDIR/run-tests.py --with-hg=`which hg` |
|
35 | 35 | |
|
36 | --- $TESTTMP/test-failure.t | |
|
37 | +++ $TESTTMP/test-failure.t.err | |
|
36 | --- $TESTTMP/test-failure.t (glob) | |
|
37 | +++ $TESTTMP/test-failure.t.err (glob) | |
|
38 | 38 | @@ -1,4 +1,4 @@ |
|
39 | 39 | $ echo babar |
|
40 | 40 | - rataxes |
@@ -87,8 +87,8 b' test for --retest' | |||
|
87 | 87 | |
|
88 | 88 | $ $TESTDIR/run-tests.py --with-hg=`which hg` --retest |
|
89 | 89 | |
|
90 | --- $TESTTMP/test-failure.t | |
|
91 | +++ $TESTTMP/test-failure.t.err | |
|
90 | --- $TESTTMP/test-failure.t (glob) | |
|
91 | +++ $TESTTMP/test-failure.t.err (glob) | |
|
92 | 92 | @@ -1,4 +1,4 @@ |
|
93 | 93 | $ echo babar |
|
94 | 94 | - rataxes |
@@ -121,8 +121,8 b' failed' | |||
|
121 | 121 | |
|
122 | 122 | $ $TESTDIR/run-tests.py --with-hg=`which hg` test-failure.t |
|
123 | 123 | |
|
124 | --- $TESTTMP/test-failure.t | |
|
125 | +++ $TESTTMP/test-failure.t.err | |
|
124 | --- $TESTTMP/test-failure.t (glob) | |
|
125 | +++ $TESTTMP/test-failure.t.err (glob) | |
|
126 | 126 | @@ -1,4 +1,4 @@ |
|
127 | 127 | $ echo babar |
|
128 | 128 | - rataxes |
General Comments 0
You need to be logged in to leave comments.
Login now