treewidget: versioned file matched ignore pattern treated as ignored - wrong

Bug #487560 reported by Alexander Belchenko
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
QBzr
Fix Released
Critical
Alexander Belchenko

Bug Description

Today treewidget.py has assumption that result of bzrlib.workingtree.WorkingTree.is_ignored() can be used as obvious sign that file is ignored. Unfortunately this is not true. File ignored only if it's not versioned. So we have to do additional check for versioned flags. The fix is straightforward:

=== modified file 'lib/treewidget.py'
--- lib/treewidget.py 2009-11-18 10:07:55 +0000
+++ lib/treewidget.py 2009-11-24 12:16:02 +0000
@@ -218,8 +218,9 @@
     [7]: executable -> 2-tuple (bool/None, bool/None)

     --optional--
- [8]: is_ignored -> If the file is ignored, pattern which caused it to
- be ignored, otherwise None.
+ [8]: ignore_pattern -> If the file name matches ignore pattern then
+ this value holds corresponding pattern,
+ otherwise None.

     NOTE: None value used for non-existing entry in corresponding
           tree, e.g. for added/deleted/ignored/unversioned
@@ -280,11 +281,16 @@
         return (desc[3] == (False, True) and desc[6][1] is None)

     def is_ignored(desc):
+ """Returns ignore pattern if file is ignored;
+ None if none pattern match;
+ False is there is pattern but file actually versioned.
+ """
         if len(desc) > 8:
- return desc[8]
+ # ignored is when file match ignore pattern and not versioned
+ return desc[8] and desc[3] == (False, False)
         else:
             return None
-
+
     def status(desc):
         if len(desc) == 8:
             (file_id, (path_in_source, path_in_target),

But it's not very clear how it affected other parts of QBzr which is used current API.

Gary, can you comment?

Tags: treewidget

Related branches

Changed in qbzr:
status: New → Won't Fix
status: Won't Fix → In Progress
importance: Undecided → Critical
assignee: nobody → Alexander Belchenko (bialix)
milestone: none → 0.17
Changed in qbzr:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.