##// END OF EJS Templates
dispatch: copy inferrepo attribute to alias commands...
Yuya Nishihara -
r27679:6822f938 default
parent child Browse files
Show More
@@ -434,6 +434,7 b' class cmdalias(object):'
434 434 self.help = ''
435 435 self.norepo = True
436 436 self.optionalrepo = False
437 self.inferrepo = False
437 438 self.badalias = None
438 439 self.unknowncmd = False
439 440
@@ -499,6 +500,8 b' class cmdalias(object):'
499 500 self.norepo = False
500 501 if cmd in commands.optionalrepo.split(' '):
501 502 self.optionalrepo = True
503 if cmd in commands.inferrepo.split(' '):
504 self.inferrepo = True
502 505 if self.help.startswith("hg " + cmd):
503 506 # drop prefix in old-style help lines so hg shows the alias
504 507 self.help = self.help[4 + len(cmd):]
@@ -557,6 +560,8 b' def addaliases(ui, cmdtable):'
557 560 commands.norepo += ' %s' % alias
558 561 if aliasdef.optionalrepo:
559 562 commands.optionalrepo += ' %s' % alias
563 if aliasdef.inferrepo:
564 commands.inferrepo += ' %s' % alias
560 565
561 566 def _parse(ui, args):
562 567 options = {}
@@ -723,9 +728,11 b' def _checkshellalias(lui, ui, args, prec'
723 728 strict = True
724 729 norepo = commands.norepo
725 730 optionalrepo = commands.optionalrepo
731 inferrepo = commands.inferrepo
726 732 def restorecommands():
727 733 commands.norepo = norepo
728 734 commands.optionalrepo = optionalrepo
735 commands.inferrepo = inferrepo
729 736 cmdtable = commands.table.copy()
730 737 addaliases(lui, cmdtable)
731 738 else:
@@ -173,6 +173,16 b' no usage'
173 173 $ hg commit -Amfoo
174 174 adding foo
175 175
176 infer repository
177
178 $ cd ..
179
180 #if no-outer-repo
181 $ hg shortlog alias/foo
182 0 e63c23eaa88a | 1970-01-01 00:00 +0000
183 #endif
184
185 $ cd alias
176 186
177 187 with opts
178 188
General Comments 0
You need to be logged in to leave comments. Login now