FindingOldBranches » History » Version 1

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

1 1 Chris Cannam
h1. Finding Old Branches
2 1 Chris Cannam
3 1 Chris Cannam
List 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 1 Chris Cannam
    while read b; do \
8 1 Chris Cannam
      oldmerges=`hg log --template '{rev}\n' -r "children(last(branch('"$b"')) and date('<Oct 1 2011'))"`; \
9 1 Chris Cannam
      if [ -n "$oldmerges" ]; then \
10 1 Chris Cannam
        echo $b ; \
11 1 Chris Cannam
      fi; \
12 1 Chris Cannam
    done
13 1 Chris Cannam
</pre>