views:

101

answers:

1

Hi, I'm looking for a DVCS which would allow me to use something like a "named commit" -- similar to what patch queues achieve, but not quite... (I'll compare only to mq and stg, since I don't know of any other similar ones)

Patch queues are close, but I'd like those features:

  • Creating new branch in the repository, branches also the patch series. (mq uses global patch queues, git loses the stg information while branching and branches with patches currently applied)
  • Ability to list the "named commits", pop and push them just like patches. (both do that)
  • Tying the "named commit" changes to normal commits - so that when I create a patch at rev 1, I change the patch at rev 3, I can still checkout rev 1 and see the old version. (mq is global again, stg fails with "not on any branch" when I come back to older revision)
  • Same as above really - ability to tag a revision in a way that if I check it out, I get the "named commits" I had then.

Is there anything similar out there? Any extensions to some DVCS? Or maybe there's a way to make mq or stg behave the way I want? Any suggestions?

It seems like mq which keeps its information is in the same repo as other files, would be close to what I need, but is that even possible?


Just to explain the purpose quickly: I want to keep the patches applied all the time, but they're not "part of development". I just want several specific features kept separately in my own fork of the main repo.

+1  A: 

You can do this with Mercurial by using mq inside of its own repo. Most commands have a --mq flag that will operate on the patch queue. To get started use hg init --mq (hg qinit also works, but that pattern is more limited, especially since qpush would be overloaded). This creates a repo inside of .hg/patches, which is independent from the main repo. Then, use mq as usual. When you want to commit your patch queue, use hg commit --mq.

You can also tag and branch with the --mq flag, to keep track of different heads. Unfortunately, it looks like the Bookmarks extension does not yet support mq, which would be nice since you probably want lightweight labels. If you wanted, though, you could set up an alias for qbookmark which just adds the -R .hg/patches so it operates on the patch queue repo.

I haven't used this extensively myself, but it looks like enough of the native Mercurial commands support --mq as to make it a possible solution for you.

tghw