Patchwork D1723: githelp: improve help for `git add`

login
register
mail settings
Submitter phabricator
Date Jan. 18, 2018, 7:58 p.m.
Message ID <c88b237211ee5722d4ad6a31dea28d67@localhost.localdomain>
Download mbox | patch
Permalink /patch/26922/
State Not Applicable
Headers show

Comments

phabricator - Jan. 18, 2018, 7:58 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHG8dbd000f7de9: githelp: improve help for `git add` (authored by indygreg, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D1723?vs=4542&id=4919

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

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

CHANGE DETAILS




To: indygreg, #hg-reviewers, durin42, pulkit
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
@@ -256,3 +256,18 @@ 
 githelp for git blame
   $ hg githelp -- git blame
   hg annotate -udl
+
+githelp for add
+
+  $ hg githelp -- git add
+  hg add
+
+  $ hg githelp -- git add -p
+  note: Mercurial will commit when complete, as there is no staging area in Mercurial
+  
+  hg commit --interactive
+
+  $ hg githelp -- git add --all
+  note: use hg addremove to remove files that have been deleted.
+  
+  hg add
diff --git a/hgext/githelp.py b/hgext/githelp.py
--- a/hgext/githelp.py
+++ b/hgext/githelp.py
@@ -156,23 +156,17 @@ 
     args, opts = parseoptions(ui, cmdoptions, args)
 
     if (opts.get('patch')):
-        ui.status(_("note: hg crecord has a better UI to record changes\n"))
-        ui.status(_("note: record and crecord will commit when complete, "
-                    "as there is no staging area in mercurial\n\n"))
-        cmd = Command('record')
+        ui.status(_("note: Mercurial will commit when complete, "
+                    "as there is no staging area in Mercurial\n\n"))
+        cmd = Command('commit --interactive')
     else:
         cmd = Command("add")
 
         if not opts.get('all'):
             cmd.extend(args)
         else:
             ui.status(_("note: use hg addremove to remove files that have "
                         "been deleted.\n\n"))
-        if not opts.get('all'):
-            cmd.extend(args)
-        else:
-            ui.status(_("note: use hg addremove to remove files that have "
-                        "been deleted.\n\n"))
 
     ui.status((str(cmd)), "\n")