# HG changeset patch
# User Adrian Buehlmann <adr...@cadifra.com>
# Date 1253908629 -7200
# Node ID 62384a2743a97efc72cf1f2fc0b1778ba63aac6c
# Parent  43024b98319f106f1618851b034be262ee662c87
logview: implement branch filtering in revgraph.filtered_log_generator

fixes issue 579

diff --git a/tortoisehg/hgtk/logview/revgraph.py 
b/tortoisehg/hgtk/logview/revgraph.py
--- a/tortoisehg/hgtk/logview/revgraph.py
+++ b/tortoisehg/hgtk/logview/revgraph.py
@@ -447,6 +447,9 @@ def filtered_log_generator(repo, pats, o
        pats - list of file names or patterns
        opts - command line options for log command
     '''
+
+    only_branch = opts.get('branch', None)
+
     # Log searches: pattern, keyword, date, etc
     df = False
     if opts['date']:
@@ -462,6 +465,13 @@ def filtered_log_generator(repo, pats, o
             continue
         if st != 'add':
             continue
+
+        ctx = get(rev)
+
+        if only_branch:
+            if ctx.branch() != only_branch:
+                continue
+
         parents = __get_parents(repo, rev)
         if opts['no_merges'] and len(parents) == 2:
             continue
@@ -475,7 +485,6 @@ def filtered_log_generator(repo, pats, o
 
         # TODO: add copies/renames later
         if opts['keyword']:
-            ctx = get(rev)
             miss = 0
             for k in [kw.lower() for kw in opts['keyword']]:
                 if not (k in ctx.user().lower() or

------------------------------------------------------------------------------
Come build with us! The BlackBerry&reg; Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9&#45;12, 2009. Register now&#33;
http://p.sf.net/sfu/devconf
_______________________________________________
Tortoisehg-develop mailing list
Tortoisehg-develop@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tortoisehg-develop

Reply via email to