FindingOldBranches » History » Version 2

Chris Cannam, 2012-02-02 09:31 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 1 Chris Cannam
      if [ -n "$oldmerges" ]; then \
11 1 Chris Cannam
        echo $b ; \
12 1 Chris Cannam
      fi; \
13 1 Chris Cannam
    done
14 1 Chris Cannam
</pre>