changeset 42588:f6540aba8e3e

subrepos: make last line of prompts <40 english chars (issue6158) Differential Revision: https://phab.mercurial-scm.org/D6572
author Kyle Lippincott <spectral@google.com>
date Mon, 24 Jun 2019 16:01:01 -0700
parents 421fdf30c37c
children 67bf11597eb8
files mercurial/subrepo.py mercurial/subrepoutil.py tests/test-largefiles-update.t tests/test-mq-subrepo.t tests/test-subrepo-git.t tests/test-subrepo-svn.t tests/test-subrepo.t
diffstat 7 files changed, 77 insertions(+), 39 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/subrepo.py	Mon Jun 24 16:00:39 2019 -0700
+++ b/mercurial/subrepo.py	Mon Jun 24 16:01:01 2019 -0700
@@ -88,13 +88,15 @@
 def _updateprompt(ui, sub, dirty, local, remote):
     if dirty:
         msg = (_(' subrepository sources for %s differ\n'
-                 'use (l)ocal source (%s) or (r)emote source (%s)?'
+                 'you can use (l)ocal source (%s) or (r)emote source (%s).\n'
+                 'what do you want to do?'
                  '$$ &Local $$ &Remote')
                % (subrelpath(sub), local, remote))
     else:
         msg = (_(' subrepository sources for %s differ (in checked out '
                  'version)\n'
-                 'use (l)ocal source (%s) or (r)emote source (%s)?'
+                 'you can use (l)ocal source (%s) or (r)emote source (%s).\n'
+                 'what do you want to do?'
                  '$$ &Local $$ &Remote')
                % (subrelpath(sub), local, remote))
     return ui.promptchoice(msg, 0)
--- a/mercurial/subrepoutil.py	Mon Jun 24 16:00:39 2019 -0700
+++ b/mercurial/subrepoutil.py	Mon Jun 24 16:01:01 2019 -0700
@@ -168,8 +168,9 @@
                 prompts['ro'] = r[0]
                 if repo.ui.promptchoice(
                     _(' subrepository sources for %(s)s differ\n'
-                      'use (l)ocal%(l)s source (%(lo)s)'
-                      ' or (r)emote%(o)s source (%(ro)s)?'
+                      'you can use (l)ocal%(l)s source (%(lo)s)'
+                      ' or (r)emote%(o)s source (%(ro)s).\n'
+                      'what do you want to do?'
                       '$$ &Local $$ &Remote') % prompts, 0):
                     debug(s, "prompt changed, get", r)
                     wctx.sub(s).get(r, overwrite)
@@ -186,7 +187,9 @@
                 option = repo.ui.promptchoice(
                     _(' subrepository %(s)s diverged (local revision: %(sl)s, '
                       'remote revision: %(sr)s)\n'
-                      '(M)erge, keep (l)ocal%(l)s or keep (r)emote%(o)s?'
+                      'you can (m)erge, keep (l)ocal%(l)s or keep '
+                      '(r)emote%(o)s.\n'
+                      'what do you want to do?'
                       '$$ &Merge $$ &Local $$ &Remote')
                     % prompts, 0)
                 if option == 0:
--- a/tests/test-largefiles-update.t	Mon Jun 24 16:00:39 2019 -0700
+++ b/tests/test-largefiles-update.t	Mon Jun 24 16:01:01 2019 -0700
@@ -545,9 +545,11 @@
   > l
   > EOF
    subrepository sub diverged (local revision: f74e50bd9e55, remote revision: d65e59e952a9)
-  (M)erge, keep (l)ocal [working copy] or keep (r)emote [destination]? m
+  you can (m)erge, keep (l)ocal [working copy] or keep (r)emote [destination].
+  what do you want to do? m
    subrepository sources for sub differ (in checked out version)
-  use (l)ocal source (f74e50bd9e55) or (r)emote source (d65e59e952a9)? r
+  you can use (l)ocal source (f74e50bd9e55) or (r)emote source (d65e59e952a9).
+  what do you want to do? r
   remote turned local largefile large2 into a normal file
   keep (l)argefile or use (n)ormal file? l
   largefile large1 has a merge conflict
--- a/tests/test-mq-subrepo.t	Mon Jun 24 16:00:39 2019 -0700
+++ b/tests/test-mq-subrepo.t	Mon Jun 24 16:01:01 2019 -0700
@@ -270,7 +270,8 @@
   $ hg qpush
   applying 1
    subrepository sub diverged (local revision: b2fdb12cd82b, remote revision: aa037b301eba)
-  (M)erge, keep (l)ocal or keep (r)emote? m
+  you can (m)erge, keep (l)ocal or keep (r)emote.
+  what do you want to do? m
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   now at: 1
   $ hg status -AS
--- a/tests/test-subrepo-git.t	Mon Jun 24 16:00:39 2019 -0700
+++ b/tests/test-subrepo-git.t	Mon Jun 24 16:01:01 2019 -0700
@@ -213,7 +213,8 @@
   (run 'hg heads' to see heads, 'hg merge' to merge)
   $ hg merge 2>/dev/null
    subrepository s diverged (local revision: 7969594, remote revision: aa84837)
-  (M)erge, keep (l)ocal [working copy] or keep (r)emote [merge rev]? m
+  you can (m)erge, keep (l)ocal [working copy] or keep (r)emote [merge rev].
+  what do you want to do? m
   pulling subrepo s from $TESTTMP/gitroot
   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
   (branch merge, don't forget to commit)
@@ -551,9 +552,11 @@
   $ cd ..
   $ hg update 4
    subrepository s diverged (local revision: da5f5b1, remote revision: aa84837)
-  (M)erge, keep (l)ocal [working copy] or keep (r)emote [destination]? m
+  you can (m)erge, keep (l)ocal [working copy] or keep (r)emote [destination].
+  what do you want to do? m
    subrepository sources for s differ
-  use (l)ocal source (da5f5b1) or (r)emote source (aa84837)? l
+  you can use (l)ocal source (da5f5b1) or (r)emote source (aa84837).
+  what do you want to do? l
   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ hg id -n
   4+
@@ -577,9 +580,11 @@
   $ cd ..
   $ hg update 1
    subrepository s diverged (local revision: 32a3438, remote revision: da5f5b1)
-  (M)erge, keep (l)ocal [working copy] or keep (r)emote [destination]? m
+  you can (m)erge, keep (l)ocal [working copy] or keep (r)emote [destination].
+  what do you want to do? m
    subrepository sources for s differ (in checked out version)
-  use (l)ocal source (32a3438) or (r)emote source (da5f5b1)? l
+  you can use (l)ocal source (32a3438) or (r)emote source (da5f5b1).
+  what do you want to do? l
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ hg id -n
   1+
@@ -599,9 +604,11 @@
   1+
   $ hg update 7
    subrepository s diverged (local revision: 32a3438, remote revision: 32a3438)
-  (M)erge, keep (l)ocal [working copy] or keep (r)emote [destination]? m
+  you can (m)erge, keep (l)ocal [working copy] or keep (r)emote [destination].
+  what do you want to do? m
    subrepository sources for s differ
-  use (l)ocal source (32a3438) or (r)emote source (32a3438)? l
+  you can use (l)ocal source (32a3438) or (r)emote source (32a3438).
+  what do you want to do? l
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ hg id -n
   7+
--- a/tests/test-subrepo-svn.t	Mon Jun 24 16:00:39 2019 -0700
+++ b/tests/test-subrepo-svn.t	Mon Jun 24 16:01:01 2019 -0700
@@ -321,9 +321,11 @@
   $ cd ..
   $ hg update tip
    subrepository s diverged (local revision: 2, remote revision: 3)
-  (M)erge, keep (l)ocal [working copy] or keep (r)emote [destination]? m
+  you can (m)erge, keep (l)ocal [working copy] or keep (r)emote [destination].
+  what do you want to do? m
    subrepository sources for s differ
-  use (l)ocal source (2) or (r)emote source (3)? l
+  you can use (l)ocal source (2) or (r)emote source (3).
+  what do you want to do? l
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ hg id -n
   2+
@@ -352,9 +354,11 @@
   $ cd ..
   $ hg update 1
    subrepository s diverged (local revision: 3, remote revision: 2)
-  (M)erge, keep (l)ocal [working copy] or keep (r)emote [destination]? m
+  you can (m)erge, keep (l)ocal [working copy] or keep (r)emote [destination].
+  what do you want to do? m
    subrepository sources for s differ (in checked out version)
-  use (l)ocal source (1) or (r)emote source (2)? l
+  you can use (l)ocal source (1) or (r)emote source (2).
+  what do you want to do? l
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ hg id -n
   1+
@@ -375,9 +379,11 @@
   1+
   $ hg update tip
    subrepository s diverged (local revision: 3, remote revision: 3)
-  (M)erge, keep (l)ocal [working copy] or keep (r)emote [destination]? m
+  you can (m)erge, keep (l)ocal [working copy] or keep (r)emote [destination].
+  what do you want to do? m
    subrepository sources for s differ
-  use (l)ocal source (1) or (r)emote source (3)? l
+  you can use (l)ocal source (1) or (r)emote source (3).
+  what do you want to do? l
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ hg id -n
   2+
@@ -409,7 +415,8 @@
   $ cd ..
   $ hg update 1
    subrepository s diverged (local revision: 3, remote revision: 2)
-  (M)erge, keep (l)ocal [working copy] or keep (r)emote [destination]? m
+  you can (m)erge, keep (l)ocal [working copy] or keep (r)emote [destination].
+  what do you want to do? m
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ hg id -n
   1+
--- a/tests/test-subrepo.t	Mon Jun 24 16:00:39 2019 -0700
+++ b/tests/test-subrepo.t	Mon Jun 24 16:01:01 2019 -0700
@@ -309,13 +309,14 @@
     subrepo t: both sides changed 
    subrepository t diverged (local revision: 20a0db6fbf6c, remote revision: 7af322bc1198)
   starting 4 threads for background file closing (?)
-  (M)erge, keep (l)ocal [working copy] or keep (r)emote [merge rev]? m
+  you can (m)erge, keep (l)ocal [working copy] or keep (r)emote [merge rev].
+  what do you want to do? m
   merging subrepository "t"
   resolving manifests
    branchmerge: True, force: False, partial: False
    ancestor: 6747d179aa9a, local: 20a0db6fbf6c+, remote: 7af322bc1198
+  starting 4 threads for background file closing (?)
    preserving t for resolve of t
-  starting 4 threads for background file closing (?)
    t: versions differ -> m (premerge)
   picked tool ':merge' for t (binary False symlink False changedelete False)
   merging t
@@ -908,7 +909,8 @@
   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ hg merge 4    # try to merge default into br again
    subrepository s diverged (local revision: f8f13b33206e, remote revision: a3f9062a4f88)
-  (M)erge, keep (l)ocal [working copy] or keep (r)emote [merge rev]? m
+  you can (m)erge, keep (l)ocal [working copy] or keep (r)emote [merge rev].
+  what do you want to do? m
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   (branch merge, don't forget to commit)
   $ cd ..
@@ -1199,7 +1201,8 @@
   added 1 changesets with 2 changes to 2 files
   new changesets c82b79fdcc5b
    subrepository sub/repo diverged (local revision: f42d5c7504a8, remote revision: 46cd4aac504c)
-  (M)erge, keep (l)ocal [working copy] or keep (r)emote [destination]? m
+  you can (m)erge, keep (l)ocal [working copy] or keep (r)emote [destination].
+  what do you want to do? m
   pulling subrepo sub/repo from $TESTTMP/issue1852a/sub/repo
   searching for changes
   adding changesets
@@ -1208,7 +1211,8 @@
   added 1 changesets with 1 changes to 1 files
   new changesets 46cd4aac504c
    subrepository sources for sub/repo differ
-  use (l)ocal source (f42d5c7504a8) or (r)emote source (46cd4aac504c)? l
+  you can use (l)ocal source (f42d5c7504a8) or (r)emote source (46cd4aac504c).
+  what do you want to do? l
   1 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ cat issue1852d/.hgsubstate
   f42d5c7504a811dda50f5cf3e5e16c3330b87172 sub/repo
@@ -1335,13 +1339,17 @@
   e95bcfa18a35+
   $ hg update tip
    subrepository s diverged (local revision: fc627a69481f, remote revision: 12a213df6fa9)
-  (M)erge, keep (l)ocal [working copy] or keep (r)emote [destination]? m
+  you can (m)erge, keep (l)ocal [working copy] or keep (r)emote [destination].
+  what do you want to do? m
    subrepository sources for s differ
-  use (l)ocal source (fc627a69481f) or (r)emote source (12a213df6fa9)? l
+  you can use (l)ocal source (fc627a69481f) or (r)emote source (12a213df6fa9).
+  what do you want to do? l
    subrepository t diverged (local revision: e95bcfa18a35, remote revision: 52c0adc0515a)
-  (M)erge, keep (l)ocal [working copy] or keep (r)emote [destination]? m
+  you can (m)erge, keep (l)ocal [working copy] or keep (r)emote [destination].
+  what do you want to do? m
    subrepository sources for t differ
-  use (l)ocal source (e95bcfa18a35) or (r)emote source (52c0adc0515a)? l
+  you can use (l)ocal source (e95bcfa18a35) or (r)emote source (52c0adc0515a).
+  what do you want to do? l
   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ hg id
   925c17564ef8+ tip
@@ -1368,11 +1376,14 @@
   $ cd ..
   $ hg update 10
    subrepository s diverged (local revision: 12a213df6fa9, remote revision: fc627a69481f)
-  (M)erge, keep (l)ocal [working copy] or keep (r)emote [destination]? m
+  you can (m)erge, keep (l)ocal [working copy] or keep (r)emote [destination].
+  what do you want to do? m
    subrepository t diverged (local revision: 52c0adc0515a, remote revision: 20a0db6fbf6c)
-  (M)erge, keep (l)ocal [working copy] or keep (r)emote [destination]? m
+  you can (m)erge, keep (l)ocal [working copy] or keep (r)emote [destination].
+  what do you want to do? m
    subrepository sources for t differ (in checked out version)
-  use (l)ocal source (7af322bc1198) or (r)emote source (20a0db6fbf6c)? l
+  you can use (l)ocal source (7af322bc1198) or (r)emote source (20a0db6fbf6c).
+  what do you want to do? l
   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ hg id
   e45c8b14af55+
@@ -1394,13 +1405,17 @@
   7af322bc1198+
   $ hg update tip
    subrepository s diverged (local revision: 12a213df6fa9, remote revision: 12a213df6fa9)
-  (M)erge, keep (l)ocal [working copy] or keep (r)emote [destination]? m
+  you can (m)erge, keep (l)ocal [working copy] or keep (r)emote [destination].
+  what do you want to do? m
    subrepository sources for s differ
-  use (l)ocal source (02dcf1d70411) or (r)emote source (12a213df6fa9)? l
+  you can use (l)ocal source (02dcf1d70411) or (r)emote source (12a213df6fa9).
+  what do you want to do? l
    subrepository t diverged (local revision: 52c0adc0515a, remote revision: 52c0adc0515a)
-  (M)erge, keep (l)ocal [working copy] or keep (r)emote [destination]? m
+  you can (m)erge, keep (l)ocal [working copy] or keep (r)emote [destination].
+  what do you want to do? m
    subrepository sources for t differ
-  use (l)ocal source (7af322bc1198) or (r)emote source (52c0adc0515a)? l
+  you can use (l)ocal source (7af322bc1198) or (r)emote source (52c0adc0515a).
+  what do you want to do? l
   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ hg id
   925c17564ef8+ tip
@@ -1426,7 +1441,8 @@
   $ cd ..
   $ hg update 11
    subrepository s diverged (local revision: 12a213df6fa9, remote revision: fc627a69481f)
-  (M)erge, keep (l)ocal [working copy] or keep (r)emote [destination]? m
+  you can (m)erge, keep (l)ocal [working copy] or keep (r)emote [destination].
+  what do you want to do? m
   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
   0 files updated, 0 files merged, 0 files removed, 0 files unresolved
   $ hg id -n