Patchwork D6459: githelp: translate --directory of git apply to --prefix

login
register
mail settings
Submitter phabricator
Date May 30, 2019, 6:02 p.m.
Message ID <80c3c20c94bd810bed2e4a3c007931dc@localhost.localdomain>
Download mbox | patch
Permalink /patch/40276/
State Not Applicable
Headers show

Comments

phabricator - May 30, 2019, 6:02 p.m.
This revision was automatically updated to reflect the committed changes.
Closed by commit rHGeddff539f5be: githelp: translate --directory of git apply to --prefix (authored by av6, committed by ).

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST UPDATE
  https://phab.mercurial-scm.org/D6459?vs=15296&id=15299

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

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

CHANGE DETAILS




To: av6, #hg-reviewers, 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,6 +256,10 @@ 
   $ hg githelp -- apply -p 5
   hg import --no-commit -p 5
 
+githelp for apply with prefix directory
+  $ hg githelp -- apply --directory=modules
+  hg import --no-commit --prefix modules
+
 git merge-base
   $ hg githelp -- git merge-base --is-ancestor
   ignoring unknown option --is-ancestor
diff --git a/hgext/githelp.py b/hgext/githelp.py
--- a/hgext/githelp.py
+++ b/hgext/githelp.py
@@ -192,12 +192,15 @@ 
 def apply(ui, repo, *args, **kwargs):
     cmdoptions = [
         ('p', 'p', int, ''),
+        ('', 'directory', '', ''),
     ]
     args, opts = parseoptions(ui, cmdoptions, args)
 
     cmd = Command('import --no-commit')
     if (opts.get('p')):
         cmd['-p'] = opts.get('p')
+    if opts.get('directory'):
+        cmd['--prefix'] = opts.get('directory')
     cmd.extend(args)
 
     ui.status((bytes(cmd)), "\n")