##// 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 self.help = ''
434 self.help = ''
435 self.norepo = True
435 self.norepo = True
436 self.optionalrepo = False
436 self.optionalrepo = False
437 self.inferrepo = False
437 self.badalias = None
438 self.badalias = None
438 self.unknowncmd = False
439 self.unknowncmd = False
439
440
@@ -499,6 +500,8 b' class cmdalias(object):'
499 self.norepo = False
500 self.norepo = False
500 if cmd in commands.optionalrepo.split(' '):
501 if cmd in commands.optionalrepo.split(' '):
501 self.optionalrepo = True
502 self.optionalrepo = True
503 if cmd in commands.inferrepo.split(' '):
504 self.inferrepo = True
502 if self.help.startswith("hg " + cmd):
505 if self.help.startswith("hg " + cmd):
503 # drop prefix in old-style help lines so hg shows the alias
506 # drop prefix in old-style help lines so hg shows the alias
504 self.help = self.help[4 + len(cmd):]
507 self.help = self.help[4 + len(cmd):]
@@ -557,6 +560,8 b' def addaliases(ui, cmdtable):'
557 commands.norepo += ' %s' % alias
560 commands.norepo += ' %s' % alias
558 if aliasdef.optionalrepo:
561 if aliasdef.optionalrepo:
559 commands.optionalrepo += ' %s' % alias
562 commands.optionalrepo += ' %s' % alias
563 if aliasdef.inferrepo:
564 commands.inferrepo += ' %s' % alias
560
565
561 def _parse(ui, args):
566 def _parse(ui, args):
562 options = {}
567 options = {}
@@ -723,9 +728,11 b' def _checkshellalias(lui, ui, args, prec'
723 strict = True
728 strict = True
724 norepo = commands.norepo
729 norepo = commands.norepo
725 optionalrepo = commands.optionalrepo
730 optionalrepo = commands.optionalrepo
731 inferrepo = commands.inferrepo
726 def restorecommands():
732 def restorecommands():
727 commands.norepo = norepo
733 commands.norepo = norepo
728 commands.optionalrepo = optionalrepo
734 commands.optionalrepo = optionalrepo
735 commands.inferrepo = inferrepo
729 cmdtable = commands.table.copy()
736 cmdtable = commands.table.copy()
730 addaliases(lui, cmdtable)
737 addaliases(lui, cmdtable)
731 else:
738 else:
@@ -173,6 +173,16 b' no usage'
173 $ hg commit -Amfoo
173 $ hg commit -Amfoo
174 adding foo
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 with opts
187 with opts
178
188
General Comments 0
You need to be logged in to leave comments. Login now