[codeface] [PATCH 04/26] Fix problem with feature blocks in a file from VCS

  • From: Claus Hunsen <hunsen@xxxxxxxxxxxxxxxxx>
  • To: codeface@xxxxxxxxxxxxx
  • Date: Thu, 13 Oct 2016 17:29:36 +0200

When there was a single-line feature change in a file, the commit has
been added to the wrong feature. This is fixed by processing the
left/upcoming features (next_features) at the end of processing lines
changed by commits in a release range.

Signed-off-by: Claus Hunsen <hunsen@xxxxxxxxxxxxxxxxx>
---
 codeface/cluster/cluster.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/codeface/cluster/cluster.py b/codeface/cluster/cluster.py
index d363ff3..f576455 100755
--- a/codeface/cluster/cluster.py
+++ b/codeface/cluster/cluster.py
@@ -365,7 +365,7 @@ def group_feature_lines(file_commit, file_state, cmt_list):
 
     # boundary case for open code-blocks or a single line file_state.
     for feature in feature_blks:
-        if feature in curr_features:  # Close all open feature blocks
+        if feature in next_features:  # Close all open feature blocks
             feature_blks[feature].append(
                 codeBlock.codeBlock(
                     blk_start[feature], blk_end[feature],
-- 
2.10.0


Other related posts:

  • » [codeface] [PATCH 04/26] Fix problem with feature blocks in a file from VCS - Claus Hunsen