FindingOldBranches » History » Version 3

Chris Cannam, 2012-02-02 09:32 AM

1 1 Chris Cannam
h1. Finding Old Branches
2 1 Chris Cannam
3 2 Chris Cannam
List bug or feature branches that have not been modified since October 2011 and that have been merged into other branches since they were last modified:
4 1 Chris Cannam
5 1 Chris Cannam
<pre>
6 1 Chris Cannam
$ hg -q branches | \
7 2 Chris Cannam
    egrep '(bug_|feature_)' | \
8 1 Chris Cannam
    while read b; do \
9 1 Chris Cannam
      oldmerges=`hg log --template '{rev}\n' -r "children(last(branch('"$b"')) and date('<Oct 1 2011'))"`; \
10 3 Chris Cannam
      [ -n "$oldmerges" ] && echo $b ; \
11 1 Chris Cannam
    done
12 1 Chris Cannam
</pre>