##// 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 return path, lui
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 options = {}
636 options = {}
632
637
633 try:
638 try:
@@ -638,14 +643,18 b' def _checkshellalias(lui, ui, args):'
638 if not args:
643 if not args:
639 return
644 return
640
645
641 norepo = commands.norepo
646 if precheck:
642 optionalrepo = commands.optionalrepo
647 norepo = commands.norepo
643 def restorecommands():
648 optionalrepo = commands.optionalrepo
644 commands.norepo = norepo
649 def restorecommands():
645 commands.optionalrepo = optionalrepo
650 commands.norepo = norepo
646
651 commands.optionalrepo = optionalrepo
647 cmdtable = commands.table.copy()
652 cmdtable = commands.table.copy()
648 addaliases(lui, cmdtable)
653 addaliases(lui, cmdtable)
654 else:
655 def restorecommands():
656 pass
657 cmdtable = commands.table
649
658
650 cmd = args[0]
659 cmd = args[0]
651 try:
660 try:
General Comments 0
You need to be logged in to leave comments. Login now