Mercurial > public > mercurial-scm > hg
comparison hgext/githelp.py @ 42395:eddff539f5be
githelp: translate --directory of git apply to --prefix
According to the help pages, these flags do the same.
Differential Revision: https://phab.mercurial-scm.org/D6459
author | Anton Shestakov <av6@dwimlabs.net> |
---|---|
date | Thu, 30 May 2019 16:38:42 +0800 |
parents | 873a28d7e962 |
children | 37ff80505dfd |
comparison
equal
deleted
inserted
replaced
42394:ad55a0a5894f | 42395:eddff539f5be |
---|---|
190 ui.status(bytes(cmd), "\n") | 190 ui.status(bytes(cmd), "\n") |
191 | 191 |
192 def apply(ui, repo, *args, **kwargs): | 192 def apply(ui, repo, *args, **kwargs): |
193 cmdoptions = [ | 193 cmdoptions = [ |
194 ('p', 'p', int, ''), | 194 ('p', 'p', int, ''), |
195 ('', 'directory', '', ''), | |
195 ] | 196 ] |
196 args, opts = parseoptions(ui, cmdoptions, args) | 197 args, opts = parseoptions(ui, cmdoptions, args) |
197 | 198 |
198 cmd = Command('import --no-commit') | 199 cmd = Command('import --no-commit') |
199 if (opts.get('p')): | 200 if (opts.get('p')): |
200 cmd['-p'] = opts.get('p') | 201 cmd['-p'] = opts.get('p') |
202 if opts.get('directory'): | |
203 cmd['--prefix'] = opts.get('directory') | |
201 cmd.extend(args) | 204 cmd.extend(args) |
202 | 205 |
203 ui.status((bytes(cmd)), "\n") | 206 ui.status((bytes(cmd)), "\n") |
204 | 207 |
205 def bisect(ui, repo, *args, **kwargs): | 208 def bisect(ui, repo, *args, **kwargs): |