-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathhgrc
111 lines (106 loc) · 3.61 KB
/
hgrc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
[ui]
username = Casey McGinty <[email protected]>
# merge = p4merge
# log style (compact, default, changelog, status, ...)
style = compact
# non-cursive UI to fix render errors
interface=text
# [extdiff]
# cmd.p4merge = /Applications/p4merge.app/Contents/Resources/launchp4merge
# [merge-tools]
# p4merge.executable = /Applications/p4merge.app/Contents/Resources/launchp4merge
# p4merge.args = $base $local $other $output
# p4merge.binary = false
# p4merge.checkchanged = true
# p4merge.dirdiff = false
# p4merge.gui = true
# p4merge.premerge = true
[templatealias]
fb_rev = if(globalrev, 'rWWW{globalrev}', rev)
fb_diff = if(phabdiff, ' {phabdiff}')
subject = truncatelonglines(desc|firstline,72,"·")
blue = '\x1B[34m'
cyan = '\x1B[36m'
green = '\x1B[32m'
red = '\x1B[31m'
reset = '\x1B[0m'
shortlog = '{blue}{fb_rev}{fb_diff}{reset} [{green}{date|age}{reset}] {subject}, {cyan}{author|person}{reset}\n'
fulllog = '{shortlog}\t{desc|strip|fill76|tabindent}\n\n'
fmods = "{file_mods % '{blue}M\t{file}\n'}"
fadds = "{file_adds % '{green}A\t{file}\n'}"
fdels = "{file_dels % '{red}R\t{file}\n'}"
namestatlog = '{shortlog}{fmods}{fadds}{fdels}\n'
fall = "{files % '{file}\n'}"
nameonlylog = '{shortlog}{fall}\n'
[alias]
top = next --top
bot = prev --bottom
bottom = prev --bottom
co = checkout
coi = revert -i
bo = backout
br = bookmark
bra = bookmark --all
branch = bookmark
bs = bisect
bsb = bisect --bad
bsc = bisect --command
bsg = bisect --good
bsr = bisect --reset
# e.g commit --amend
cam = amend
ams = amend --stack
ami = amend --interactive
cm = commit
cma = metaedit
cmi = commit --interactive
dg = diffgrep
dh = diff --rev '.^'
di = diff
diffgrep = !$HG log --patch --template 'rWWW{globalrev}\n{fulllog}' $@ | while read -r LINE; do REV=$(echo "$LINE" | grep -Eo '^rWWW[[:digit:]]+$' || echo "$REV"); echo "$REV" "$LINE"; done
diffsize = !$HG log --template 'rWWW{globalrev}\n{stat()}' $@ | while read -r LINE; do REV=$(echo "$LINE" | grep -Eo '^rWWW[[:digit:]]+$' || echo "$REV"); [[ -n $REV ]] || continue; (echo "$LINE" | grep -Eq '[0-9]+ files changed') || continue; CHG=$(echo "$LINE" | gawk 'z=0;match($z, /([0-9]+).*, ([0-9]+).*, ([0-9]+)/, a) { print a[1]+a[2]+a[3] }'); echo "$CHG" "$REV"; done | sort -n
drop = hide
dropall = hide 'draft() and not .'
hideall = hide 'draft() and not .'
fetch = !HGPLAIN=1 $HG pull
gg = grep
lg = log --template '{shortlog}'
lgd = log --limit 1 --template '{phabdiff}\n'
lgf = log --template '{fulllog}'
lgm = log
lgno = log --template '{nameonlylog}'
lgnr = log --template "{files % '{fb_rev} {file}\n'}"
lgns = log --template '{namestatlog}'
lgp = lg --patch
lgp1 = lg --limit 1 --patch
lgr = log --limit 1 --template '{fb_rev}\n'
lgs = lg --stat
lgv = log --template '{fulllog}'
pl = pull --rebase --dest stable
plm = pull --rebase --dest master
push = push --to master
slh = sl --hidden
rbm = rebase --dest master --base
rb = rebase --dest stable --base
rbs = rebase --dest stable --source
rba = rebase --abort
rbc = rebase --continue
# rebase all local branches
sync = rebase --dest stable --rev 'draft()'
rbi = histedit
he = histedit
hea = histedit --abort
hec = histedit --continue
rbib = histedit -r bottom
rs = !$HG uncommit && $HG undo --keep
rt = revert
rsh = !$HG revert --all && $HG checkout -C .
rta = revert --all
rti = revert --interactive
cop = revert --interactive
sha = identify
slh = sl --hidden
slp = sl --patch
sls = sl --stat
sp = sparse
u = undo