0

We are using Bamboo and Plan Branching to manage our feature-branch and release cycle.

Synopsis (in case your curious) Essentially, whenever a commit is pushed on a feature branch, Bamboo kicks in and merges the development trunk to the branch to confirm the developer has broken anyone else's accepted (approved via pull request) commits that are in the development trunk.

However, even if a developer closes the branch, or the pull-request approver closes the branch, bamboo kicks in an creates a final merge commit thus re-opening the branch. This has created a lot of clutter in the source-control as people forget to manually go back and close their branches again (as they've already closed them).

I wanted to pipe together some commands to script the closing of any branch that hasn't been committed too say in the last 5 days? Or perhaps prior to a revision number?

hg log, hg status, or hg log --template "{date|localdate|rfc822date}\n"

Seem promising, but I'm sure someone has to have concatenated a few calls?

Or if there is a way to add some instruction to Mercurial that would be great as well!

jordan.baucke
  • 4,308
  • 10
  • 54
  • 77
  • 1
    Maybe fix Bamboo will be better choice? At least merge not development into feature-branch, but feature-branch into some $HEAPBRANCH (synced mirror of development branch) – Lazy Badger Apr 18 '14 at 01:51
  • 1
    Read also about trick from http://stackoverflow.com/a/23122570/960558 – Lazy Badger Apr 18 '14 at 01:52
  • What you want to do is check out all the opened branches using `hg branches`, and iterate through their heads to get the last commit date: `hg log -r --template "{date}"`. You do not mention the system you use, so you'll have to create the script yourself! – Vince Apr 19 '14 at 07:16
  • @Vince - ugly, not-Mercurial way – Lazy Badger Apr 19 '14 at 14:28
  • @LazyBadger - True, this is why it is just a comment, and why I upvoted your other comments! Only giving him some hints. – Vince Apr 19 '14 at 15:20
  • @Vince got it I'm going to work on. – jordan.baucke Apr 21 '14 at 16:09

0 Answers0