2328 return partial |
2328 return partial |
2329 |
2329 |
2330 if repo.local(): |
2330 if repo.local(): |
2331 repo.__class__ = mqrepo |
2331 repo.__class__ = mqrepo |
2332 repo.mq = queue(ui, repo.join("")) |
2332 repo.mq = queue(ui, repo.join("")) |
|
2333 |
|
2334 def uisetup(ui): |
|
2335 # override import to disallow importing over patch |
|
2336 importalias, importcmd = cmdutil.findcmd(ui, 'import', commands.table) |
|
2337 for alias, cmd in commands.table.iteritems(): |
|
2338 if cmd is importcmd: |
|
2339 importkey = alias |
|
2340 break |
|
2341 orig_import = importcmd[0] |
|
2342 def mqimport(ui, repo, patch1, *patches, **opts): |
|
2343 if hasattr(repo, 'abort_if_wdir_patched'): |
|
2344 repo.abort_if_wdir_patched(_('cannot import over an applied patch'), |
|
2345 opts.get('force')) |
|
2346 orig_import(ui, repo, patch1, *patches, **opts) |
|
2347 importcmd = list(importcmd) |
|
2348 importcmd[0] = mqimport |
|
2349 commands.table[importkey] = tuple(importcmd) |
2333 |
2350 |
2334 seriesopts = [('s', 'summary', None, _('print first line of patch header'))] |
2351 seriesopts = [('s', 'summary', None, _('print first line of patch header'))] |
2335 |
2352 |
2336 cmdtable = { |
2353 cmdtable = { |
2337 "qapplied": (applied, [] + seriesopts, _('hg qapplied [-s] [PATCH]')), |
2354 "qapplied": (applied, [] + seriesopts, _('hg qapplied [-s] [PATCH]')), |