Patchwork D6956: unfinishedstate: suggested `hg update .` (including `.`) to complete update

login
register
mail settings
Submitter phabricator
Date Oct. 3, 2019, 8:18 p.m.
Message ID <differential-rev-PHID-DREV-k6nx4zb2zyf33aqyyova-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/41942/
State Superseded
Headers show

Comments

phabricator - Oct. 3, 2019, 8:18 p.m.
martinvonz created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REVISION SUMMARY
  `hg update` can update to a different and undesired commit. For users
  who have commands.update.requiredest=yes, it's even an error to run
  just `hg update.

REPOSITORY
  rHG Mercurial

REVISION DETAIL
  https://phab.mercurial-scm.org/D6956

AFFECTED FILES
  mercurial/state.py
  tests/test-merge1.t

CHANGE DETAILS




To: martinvonz, #hg-reviewers
Cc: mercurial-devel
phabricator - Oct. 4, 2019, 3:06 p.m.
spectral added inline comments.

INLINE COMMENTS

> state.py:204
>      cmdhint=_("use 'hg update' to get a consistent checkout"),
> -    statushint=_("To continue:    hg update")
> +    statushint=_("To continue:    hg update .")
>  )

I wonder if it would be possible to portably quote the `.` so that users don't think it's just sitting on the end there.  Something like `hg update '.'` If not, then we should surround the entire thing in quotes if possible, something like `To continue:   'hg update .'`

Thoughts?

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D6956/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D6956

To: martinvonz, #hg-reviewers
Cc: spectral, mercurial-devel
phabricator - Oct. 15, 2019, 1:47 p.m.
martinvonz added inline comments.

INLINE COMMENTS

> spectral wrote in state.py:204
> I wonder if it would be possible to portably quote the `.` so that users don't think it's just sitting on the end there.  Something like `hg update '.'` If not, then we should surround the entire thing in quotes if possible, something like `To continue:   'hg update .'`
> 
> Thoughts?

We often quote the whole command like you did in your second example. However, I don't really want to do that with all the commands here (e.g. the bisect commands a few lines down). We could quote just the `'.'`, but I think it's already quite clear from the context that the `.` is part of the command -- the spaces before it makes it look like it's not part of a sentence.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D6956/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D6956

To: martinvonz, #hg-reviewers
Cc: spectral, mercurial-devel

Patch

diff --git a/tests/test-merge1.t b/tests/test-merge1.t
--- a/tests/test-merge1.t
+++ b/tests/test-merge1.t
@@ -49,7 +49,7 @@ 
   ? b/nonempty
   # The repository is in an unfinished *update* state.
   
-  # To continue:    hg update
+  # To continue:    hg update .
   
 
   $ rm b/nonempty
diff --git a/mercurial/state.py b/mercurial/state.py
--- a/mercurial/state.py
+++ b/mercurial/state.py
@@ -201,7 +201,7 @@ 
     'update', fname='updatestate', clearable=True,
     cmdmsg=_('last update was interrupted'),
     cmdhint=_("use 'hg update' to get a consistent checkout"),
-    statushint=_("To continue:    hg update")
+    statushint=_("To continue:    hg update .")
 )
 addunfinished(
     'bisect', fname='bisect.state', allowcommit=True, reportonly=True,