Fossil-like aliases
Marcos Cruz
mercurial-list at programandala.net
Sat Nov 5 12:29:50 UTC 2022
I've been using Fossil (https://fossil-scm.org) for two years. Some
months ago, when I started using Mercurial, I wrote some Fossil-like
aliases to make the migration easier:
```
[alias]
# Fossil-like commands:
changes = status -a -d -m -r
extras = status -u -n
finfo = log --follow
info = !hg summary;hg status
leaves = heads
ls = files
praise = annotate
timeline = log
ui = !~/.config/hg/extensions/ui
zip = archive --type zip
```
The Fossil "ui" command initializes the web server and starts the web
browser. I wrote its Mercurial equivalent in fish
(https://fishshell.com), which is my default shell:
```
#!/usr/bin/env fish
set temp_file (mktemp)
hg serve --port 0 > $temp_file &
while test 0 -eq (stat --format=%s $temp_file)
end
set url (sed -e 's/.*\(http\S\+\).*/\1/' $temp_file)
$BROWSER $url &
```
I rarely use the web server, but I find "ui" very handy when I do.
I find "changes" and "extras" very useful, I use them a lot instead of
the generic "status".
--
Marcos Cruz
http://programandala.net
More information about the Mercurial
mailing list