##// END OF EJS Templates
dispatch: add shell aliases...
Steve Losh -
r11524:24965bb2 default
parent child Browse files
Show More
@@ -1866,7 +1866,10 b' def help_(ui, name=None, with_version=Fa'
1866 if not doc:
1866 if not doc:
1867 doc = _("(no help text available)")
1867 doc = _("(no help text available)")
1868 if hasattr(entry[0], 'definition'): # aliased command
1868 if hasattr(entry[0], 'definition'): # aliased command
1869 doc = _('alias for: hg %s\n\n%s') % (entry[0].definition, doc)
1869 if entry[0].definition.startswith('!'): # shell alias
1870 doc = _('shell alias for::\n\n %s') % entry[0].definition[1:]
1871 else:
1872 doc = _('alias for: hg %s\n\n%s') % (entry[0].definition, doc)
1870 if ui.quiet:
1873 if ui.quiet:
1871 doc = doc.splitlines()[0]
1874 doc = doc.splitlines()[0]
1872 keep = ui.verbose and ['verbose'] or []
1875 keep = ui.verbose and ['verbose'] or []
@@ -208,6 +208,13 b' class cmdalias(object):'
208
208
209 return
209 return
210
210
211 if self.definition.startswith('!'):
212 def fn(ui, *args):
213 cmd = '%s %s' % (self.definition[1:], ' '.join(args))
214 return util.system(cmd)
215 self.fn = fn
216 return
217
211 args = shlex.split(self.definition)
218 args = shlex.split(self.definition)
212 cmd = args.pop(0)
219 cmd = args.pop(0)
213 args = map(util.expandpath, args)
220 args = map(util.expandpath, args)
@@ -14,6 +14,7 b" shortlog = log --template '{rev} {node|s"
14 dln = lognull --debug
14 dln = lognull --debug
15 nousage = rollback
15 nousage = rollback
16 put = export -r 0 -o "\$FOO/%R.diff"
16 put = export -r 0 -o "\$FOO/%R.diff"
17 echo = !echo
17
18
18 [defaults]
19 [defaults]
19 mylog = -q
20 mylog = -q
@@ -64,3 +65,6 b' hg dln'
64 echo '% path expanding'
65 echo '% path expanding'
65 FOO=`pwd` hg put
66 FOO=`pwd` hg put
66 cat 0.diff
67 cat 0.diff
68
69 echo '% shell aliases'
70 hg echo foo
@@ -43,3 +43,5 b' diff -r 000000000000 -r e63c23eaa88a foo'
43 +++ b/foo Thu Jan 01 00:00:00 1970 +0000
43 +++ b/foo Thu Jan 01 00:00:00 1970 +0000
44 @@ -0,0 +1,1 @@
44 @@ -0,0 +1,1 @@
45 +foo
45 +foo
46 % shell aliases
47 foo
General Comments 0
You need to be logged in to leave comments. Login now