##// END OF EJS Templates
dispatch: make "_checkshellalias" reusable regardless of adding aliases...
FUJIWARA Katsunori -
r22376:d821fff9 stable
parent child Browse files
Show More
@@ -627,7 +627,12 b' def _getlocal(ui, rpath):'
627 627
628 628 return path, lui
629 629
630 def _checkshellalias(lui, ui, args):
630 def _checkshellalias(lui, ui, args, precheck=True):
631 """Return the function to run the shell alias, if it is required
632
633 'precheck' is whether this function is invoked before adding
634 aliases or not.
635 """
631 636 options = {}
632 637
633 638 try:
@@ -638,14 +643,18 b' def _checkshellalias(lui, ui, args):'
638 643 if not args:
639 644 return
640 645
641 norepo = commands.norepo
642 optionalrepo = commands.optionalrepo
643 def restorecommands():
644 commands.norepo = norepo
645 commands.optionalrepo = optionalrepo
646
647 cmdtable = commands.table.copy()
648 addaliases(lui, cmdtable)
646 if precheck:
647 norepo = commands.norepo
648 optionalrepo = commands.optionalrepo
649 def restorecommands():
650 commands.norepo = norepo
651 commands.optionalrepo = optionalrepo
652 cmdtable = commands.table.copy()
653 addaliases(lui, cmdtable)
654 else:
655 def restorecommands():
656 pass
657 cmdtable = commands.table
649 658
650 659 cmd = args[0]
651 660 try:
General Comments 0
You need to be logged in to leave comments. Login now