Mercurial > hg
annotate tests/test-issue522.out @ 11989:f853873fc66d
aliases: provide more flexible ways to work with shell alias arguments
This patch changes the functionality of shell aliases to add more powerful
options for working with shell alias arguments.
First: the alias name + arguments to a shell alias are set as an HG_ARGS
environment variable, delimited by spaces. This matches the behavior of hooks.
Second: any occurrences of "$@" (without quotes) are replaced with the
arguments, separated by spaces. This happens *before* the alias gets to the shell.
Third: any positive numeric variables ("$1", "$2", etc) are replaced with the
appropriate argument, indexed from 1. "$0" is replaced with the name of the
alias. Any "extra" numeric variables are replaced with an empty string. This
happens *before* the alias gets to the shell.
These changes allow for more flexible shell aliases:
[alias]
echo = !echo $@
count = !hg log -r "$@" --template='.' | wc -c | sed -e 's/ //g'
qqueuemv = !mv "`hg root`/.hg/patches-$1" "`hg root`/.hg/patches-$2"
In action:
$ hg echo foo
foo
$ hg count 'branch(default)'
901
$ hg count 'branch(stable) and keyword(fixes)'
102
$ hg qqueuemv myfeature somefeature
author | Steve Losh <steve@stevelosh.com> |
---|---|
date | Wed, 18 Aug 2010 18:56:44 -0400 |
parents | db426935fa94 |
children |
rev | line source |
---|---|
5210
90d9ec0dc69d
merge: forcefully mark files that we get from the second parent as dirty
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
1 reverting foo |
90d9ec0dc69d
merge: forcefully mark files that we get from the second parent as dirty
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
2 changeset 2:4d9e78aaceee backs out changeset 1:b515023e500e |
90d9ec0dc69d
merge: forcefully mark files that we get from the second parent as dirty
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
3 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
8753
af5f099d932b
merge: refactor manifestmerge init to better report effective ancestor
Matt Mackall <mpm@selenic.com>
parents:
5858
diff
changeset
|
4 searching for copies back to rev 1 |
af5f099d932b
merge: refactor manifestmerge init to better report effective ancestor
Matt Mackall <mpm@selenic.com>
parents:
5858
diff
changeset
|
5 unmatched files in local: |
af5f099d932b
merge: refactor manifestmerge init to better report effective ancestor
Matt Mackall <mpm@selenic.com>
parents:
5858
diff
changeset
|
6 bar |
5210
90d9ec0dc69d
merge: forcefully mark files that we get from the second parent as dirty
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
7 resolving manifests |
90d9ec0dc69d
merge: forcefully mark files that we get from the second parent as dirty
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
8 overwrite None partial False |
90d9ec0dc69d
merge: forcefully mark files that we get from the second parent as dirty
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
9 ancestor bbd179dfa0a7 local 71766447bdbb+ remote 4d9e78aaceee |
90d9ec0dc69d
merge: forcefully mark files that we get from the second parent as dirty
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
10 foo: remote is newer -> g |
11716
db426935fa94
progress: use gerund (updating) for merge progress
timeless <timeless@gmail.com>
parents:
10431
diff
changeset
|
11 updating: foo 1/1 files (100.00%) |
5210
90d9ec0dc69d
merge: forcefully mark files that we get from the second parent as dirty
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
12 getting foo |
90d9ec0dc69d
merge: forcefully mark files that we get from the second parent as dirty
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
13 1 files updated, 0 files merged, 0 files removed, 0 files unresolved |
90d9ec0dc69d
merge: forcefully mark files that we get from the second parent as dirty
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
14 (branch merge, don't forget to commit) |
5858
e7ed5d07cc4c
Display debugstate dates as '%Y-%m-%d %H:%M:%S'
Giorgos Keramidas <keramida@ceid.upatras.gr>
parents:
5405
diff
changeset
|
15 n 0 -2 unset foo |
5210
90d9ec0dc69d
merge: forcefully mark files that we get from the second parent as dirty
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
16 M foo |
5405
8feb33c2d153
Display symlink or executable bit with manifest -v
Patrick Mezard <pmezard@gmail.com>
parents:
5371
diff
changeset
|
17 c6fc755d7e68f49f880599da29f15add41f42f5a 644 foo |
5210
90d9ec0dc69d
merge: forcefully mark files that we get from the second parent as dirty
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
18 rev offset length base linkrev nodeid p1 p2 |
90d9ec0dc69d
merge: forcefully mark files that we get from the second parent as dirty
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
19 0 0 5 0 0 2ed2a3912a0b 000000000000 000000000000 |
90d9ec0dc69d
merge: forcefully mark files that we get from the second parent as dirty
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
20 1 5 9 1 1 6f4310b00b9a 2ed2a3912a0b 000000000000 |
90d9ec0dc69d
merge: forcefully mark files that we get from the second parent as dirty
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents:
diff
changeset
|
21 2 14 5 2 2 c6fc755d7e68 6f4310b00b9a 000000000000 |