Mercurial > hg
comparison tests/test-merge-tools.t @ 42565:4764e8436b2a
filemerge: make last line of prompts <40 english chars (issue6158)
I've chosen <40 as the target so that other languages that may have a 2x blowup
in character count can still have a chance to fit into an 80 column screen.
Previously, we would show a prompt like:
```
keep (l)ocal [dest], take (o)ther [source], or leave (u)nresolved for some/potentially/really/long/path?
```
On at least some systems, if readline was in use then the last line of the
prompt would be wrapped strangely if it couldn't fit entirely on one line. This
strange wrapping may be just a carriage return without a line feed, overwriting
the beginning of the line; example (100 columns wide, 65 character filename, and
yes there's 10 spaces on the end, I assume this is to handle the user inputting
longest word we provide as an option, "unresolved"):
```
ng/dir/name/that/does/not/work/well/with/readline/file.txt? ave (u)nresolved for some/lon
```
In some cases it may partially wrap onto the next line, but still be missing
earlier parts in the line, such as below (60 columns wide, 65 character
filename):
```
rev], or leave (u)nresolved for some/long/dir/name/that/do
s/not/work/well/with/readline/file.txt?
```
With this fix, this looks like this on a 60 column screen:
```
tool vim_with_markers (for pattern some/long/dir/name/that/d
oes/not/work/well/with/readline/file.txt) can't handle binar
y
tool meld can't handle binary
tool vim_with_markers can't handle binary
tool internal:merge3 can't handle binary
tool merge can't handle binary
no tool found to merge some/long/dir/name/that/does/not/work
/well/with/readline/file.txt
file 'some/long/dir/name/that/does/not/work/well/with/readli
ne/file.txt' needs to be resolved.
You can keep (l)ocal [working copy], take (o)ther [merge rev
], or leave (u)nresolved.
What do you want to do?
```
Differential Revision: https://phab.mercurial-scm.org/D6562
author | Kyle Lippincott <spectral@google.com> |
---|---|
date | Thu, 20 Jun 2019 11:40:47 -0700 |
parents | ff37b1712fa5 |
children | 558f7585afcb |
comparison
equal
deleted
inserted
replaced
42561:44e99811bea7 | 42565:4764e8436b2a |
---|---|
711 false.whatever= | 711 false.whatever= |
712 true.priority=1 | 712 true.priority=1 |
713 true.executable=cat | 713 true.executable=cat |
714 # hg update -C 1 | 714 # hg update -C 1 |
715 $ hg merge -r 2 --config ui.merge=internal:prompt | 715 $ hg merge -r 2 --config ui.merge=internal:prompt |
716 keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved for f? u | 716 file 'f' needs to be resolved. |
717 You can keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved. | |
718 What do you want to do? u | |
717 0 files updated, 0 files merged, 0 files removed, 1 files unresolved | 719 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
718 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon | 720 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon |
719 [1] | 721 [1] |
720 $ aftermerge | 722 $ aftermerge |
721 # cat f | 723 # cat f |
735 true.executable=cat | 737 true.executable=cat |
736 # hg update -C 1 | 738 # hg update -C 1 |
737 $ hg merge -r 2 --config ui.merge=:prompt --config ui.interactive=True << EOF | 739 $ hg merge -r 2 --config ui.merge=:prompt --config ui.interactive=True << EOF |
738 > u | 740 > u |
739 > EOF | 741 > EOF |
740 keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved for f? u | 742 file 'f' needs to be resolved. |
743 You can keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved. | |
744 What do you want to do? u | |
741 0 files updated, 0 files merged, 0 files removed, 1 files unresolved | 745 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
742 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon | 746 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon |
743 [1] | 747 [1] |
744 $ aftermerge | 748 $ aftermerge |
745 # cat f | 749 # cat f |
757 false.whatever= | 761 false.whatever= |
758 true.priority=1 | 762 true.priority=1 |
759 true.executable=cat | 763 true.executable=cat |
760 # hg update -C 1 | 764 # hg update -C 1 |
761 $ hg merge -r 2 --config ui.merge=internal:prompt --config ui.interactive=true | 765 $ hg merge -r 2 --config ui.merge=internal:prompt --config ui.interactive=true |
762 keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved for f? | 766 file 'f' needs to be resolved. |
767 You can keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved. | |
768 What do you want to do? | |
763 0 files updated, 0 files merged, 0 files removed, 1 files unresolved | 769 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
764 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon | 770 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon |
765 [1] | 771 [1] |
766 $ aftermerge | 772 $ aftermerge |
767 # cat f | 773 # cat f |
770 # hg stat | 776 # hg stat |
771 M f | 777 M f |
772 # hg resolve --list | 778 # hg resolve --list |
773 U f | 779 U f |
774 $ hg resolve --all --config ui.merge=internal:prompt --config ui.interactive=true | 780 $ hg resolve --all --config ui.merge=internal:prompt --config ui.interactive=true |
775 keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved for f? | 781 file 'f' needs to be resolved. |
782 You can keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved. | |
783 What do you want to do? | |
776 [1] | 784 [1] |
777 $ aftermerge | 785 $ aftermerge |
778 # cat f | 786 # cat f |
779 revision 1 | 787 revision 1 |
780 space | 788 space |
783 ? f.orig | 791 ? f.orig |
784 # hg resolve --list | 792 # hg resolve --list |
785 U f | 793 U f |
786 $ rm f | 794 $ rm f |
787 $ hg resolve --all --config ui.merge=internal:prompt --config ui.interactive=true | 795 $ hg resolve --all --config ui.merge=internal:prompt --config ui.interactive=true |
788 keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved for f? | 796 file 'f' needs to be resolved. |
797 You can keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved. | |
798 What do you want to do? | |
789 [1] | 799 [1] |
790 $ aftermerge | 800 $ aftermerge |
791 # cat f | 801 # cat f |
792 revision 1 | 802 revision 1 |
793 space | 803 space |
794 # hg stat | 804 # hg stat |
795 M f | 805 M f |
796 # hg resolve --list | 806 # hg resolve --list |
797 U f | 807 U f |
798 $ hg resolve --all --config ui.merge=internal:prompt | 808 $ hg resolve --all --config ui.merge=internal:prompt |
799 keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved for f? u | 809 file 'f' needs to be resolved. |
810 You can keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved. | |
811 What do you want to do? u | |
800 [1] | 812 [1] |
801 $ aftermerge | 813 $ aftermerge |
802 # cat f | 814 # cat f |
803 revision 1 | 815 revision 1 |
804 space | 816 space |
1906 tool :other (for pattern b) can't handle binary | 1918 tool :other (for pattern b) can't handle binary |
1907 tool true can't handle binary | 1919 tool true can't handle binary |
1908 tool :other can't handle binary | 1920 tool :other can't handle binary |
1909 tool false can't handle binary | 1921 tool false can't handle binary |
1910 no tool found to merge b | 1922 no tool found to merge b |
1911 keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved for b? u | 1923 file 'b' needs to be resolved. |
1924 You can keep (l)ocal [working copy], take (o)ther [merge rev], or leave (u)nresolved. | |
1925 What do you want to do? u | |
1912 0 files updated, 0 files merged, 0 files removed, 1 files unresolved | 1926 0 files updated, 0 files merged, 0 files removed, 1 files unresolved |
1913 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon | 1927 use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon |
1914 [1] | 1928 [1] |
1915 $ hg merge --abort -q | 1929 $ hg merge --abort -q |
1916 | 1930 |