A handy revset hack - public

Augie Fackler durin42 at gmail.com
Sun Jul 17 20:21:26 CDT 2011


On Jul 13, 2011, at 6:27 PM, Matt Mackall wrote:
> 
> I've added this to my .hgrc:
> 
> [revsetalias]
> public = (not outgoing("http://selenic.com/hg") or not
> outgoing("http://hg.intevation.org/mercurial/crew/"))
> 
> Now I can do:
> 
> hg log -r 'not public'
> 
> and find any commits that are not published on either the main repo or
> on crew. Among other things, this lets me know what's safe to rebase or
> otherwise tweak.

I feel like I should point out that my remotebranches extension adds an "upstream" revset that is identical in functionality, but uses a snapshot of the branch heads from the last time the path was pushed to or pulled from. For example, my crew repo is configured thus:

augie% cat .hg/hgrc
[paths]
default=http://hg.intevation.org/mercurial/crew
crew=http://hg.intevation.org/mercurial/crew
mpm=http://selenic.com/hg

[remotebranches]
upstream=crew,mpm

So that now

augie% hg log --graph -r 'not upstream()'

shows the changesets which are neither in mpm's repo or crew. I also find this alias helpful:

[alias]
upstream-bookmarks=log -r 'bookmark() and upstream()' --template '{bookmarks}\n'

which gives you a command that shows what bookmarks have been accepted upstream (particularly useful with rebase in my experience).


More information about the Mercurial-devel mailing list