Patchwork D1728: githelp: improve help for "reset"

login
register
mail settings
Submitter phabricator
Date Dec. 23, 2017, 1:40 a.m.
Message ID <db380aa6de4514ba0a1697c7250cd563@localhost.localdomain>
Download mbox | patch
Permalink /patch/26420/
State Not Applicable
Headers show

Comments

phabricator - Dec. 23, 2017, 1:40 a.m.
indygreg updated this revision to Diff 4596.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D1728?vs=4547&id=4596

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

AFFECTED FILES
  hgext/githelp.py
  tests/test-githelp.t

CHANGE DETAILS




To: indygreg, #hg-reviewers, durin42
Cc: mercurial-devel

Patch

diff --git a/tests/test-githelp.t b/tests/test-githelp.t
--- a/tests/test-githelp.t
+++ b/tests/test-githelp.t
@@ -158,11 +158,22 @@ 
 
 githelp for reset, checking ~ in git becomes ~1 in mercurial
   $ hg githelp -- reset HEAD~
-  hg reset .~1
+  hg update .~1
   $ hg githelp -- reset "HEAD^"
-  hg reset .^
+  hg update .^
   $ hg githelp -- reset HEAD~3
-  hg reset .~3
+  hg update .~3
+
+  $ hg githelp -- reset --mixed HEAD
+  NOTE: --mixed has no meaning since Mercurial has no staging area
+  
+  hg update .
+  $ hg githelp -- reset --soft HEAD
+  NOTE: --soft has no meaning since Mercurial has no staging area
+  
+  hg update .
+  $ hg githelp -- reset --hard HEAD
+  hg update --clean .
 
 githelp for git show --name-status
   $ hg githelp -- git show --name-status
diff --git a/hgext/githelp.py b/hgext/githelp.py
--- a/hgext/githelp.py
+++ b/hgext/githelp.py
@@ -808,12 +808,16 @@ 
     hard = opts.get('hard')
 
     if opts.get('mixed'):
-        ui.status(_('NOTE: --mixed has no meaning since mercurial has no ' +
+        ui.status(_('NOTE: --mixed has no meaning since Mercurial has no '
+                    'staging area\n\n'))
+    if opts.get('soft'):
+        ui.status(_('NOTE: --soft has no meaning since Mercurial has no '
                     'staging area\n\n'))
 
-    cmd = Command('reset')
+    cmd = Command('update')
     if hard:
         cmd.append('--clean')
+
     cmd.append(commit)
 
     ui.status((str(cmd)), "\n")