[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mercurial
Subject:    Re: Bookbinder: manipulate the series of commits "within" a bookmark
From:       Ernie Rael <err () raelity ! com>
Date:       2015-03-30 16:33:36
Message-ID: 55197AE0.4030206 () raelity ! com
[Download RAW message or body]

Nice,

Seems like simply including "feature(<rev>)" as a builtin revset 
predicate, visible in 'hg help revset', could be compatible and  very 
useful in the core.

I'm not sure how new stuff is introduced. Does it make sense to have an 
option for the bookbinder extension that only exposes "feature()" and 
doesn't change the behavior of "--rev" in all commands? And/or perhaps a 
option could flip the meaning of '.' in "-r .mark", so that "-r mark" is 
the single revision and "-r .mark" is "-r feature(mark)".

-ernie

On 3/30/2015 8:21 AM, Andrew Halberstadt wrote:
> Hey all,
>
> I wrote a new extension that makes it easy to find and manipulate the 
> series of commits "within" a bookmark:
> https://bitbucket.org/halbersa/bookbinder
>
> It finds and wraps all commands (including from installed extensions) 
> that have a --rev option and support revsets. If you pass in -r 
> <bookmark> into that command, it will replace the single commit 
> pointed to by the bookmark label with the series of commits "inside" 
> the bookmark. E.g:
>
>     $ hg log -r <bookmark>
>     $ hg rebase -r <bookmark> -d <dest>
>     $ hg graft -r <bookmark>
>     $ hg fold -r <bookmark>
>     $ hg prune -r <bookmark>
>     $ hg grep -r <bookmark>
>     etc..
>
> It works by defining a `feature` revset. In short, `hg log -r 
> 'feature(<rev>)'` will return all ancestor commits of <rev> that 
> aren't public, a merge commit, or "within" a different bookmark. The 
> last point means you can base bookmarks on top of one another without 
> getting them mixed up.
>
> In the event that you actually do want to use the bookmark as a label 
> to a single commit, you can escape it with a period:
>
>     $ hg log -r .my_bookmark
>
> For more details, please see the blog post I wrote on the topic:
> http://ahal.ca/blog/2015/making-mercurial-bookmarks-more-git-like/
>
> Feedback is much appreciated!
>
> -Andrew
> _______________________________________________
> Mercurial mailing list
> Mercurial@selenic.com
> http://selenic.com/mailman/listinfo/mercurial

_______________________________________________
Mercurial mailing list
Mercurial@selenic.com
http://selenic.com/mailman/listinfo/mercurial

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic