Commits

Jens Alfke committed 295c56f

Speculative fix for bug #89, a KVO screwup involving the 'formattedDescription' property. Also makes revision table update immediately when the rev log pane's text is edited.

Comments (0)

Files changed (4)

         if( pos )
             maxPos = MAX(maxPos, pos-kStatusPriorities);
     }
-    if( maxPos >= 0 )
-        self.status = kStatusPriorities[maxPos];
-    else
-        self.status = kClean;
+    HgStatus newStatus = (maxPos >= 0) ?kStatusPriorities[maxPos] :kClean;
+    if (newStatus != self.status)
+        self.status = newStatus;
 }
 
 - (NSMutableString*) _getPath: (BOOL)absolute
                 // OK, add/update it:
                 path = [path substringFromIndex: myPath.length];
                 HgFile *file = [self addFileWithPath: path];
-                file.status = status;
+                if (status != file.status)
+                    file.status = status;
                 [oldFiles removeObject: file];
                 LogTo(HgFile,@"    %c %@", file.status,file.path);
             }
     return strchr("MAR!?", _status) != NULL;
 }
 
++ (NSArray*) keyPathsForValuesAffectingIsUncommitted  {return [NSArray arrayWithObject: @"status"];}
+
 
 - (int) compare: (id)object
 {

Source/HgRepository.m

 
 + (NSArray*) keyPathsForValuesAffectingCurrentRevision      {return [NSArray arrayWithObject: @"revisions"];}
 + (NSArray*) keyPathsForValuesAffectingTipRevision          {return [NSArray arrayWithObject: @"revisions"];}
-+ (NSArray*) keyPathsForValuesAffectingModifiedRevision     {return [NSArray arrayWithObject: @"revisions"];}
 + (NSArray*) keyPathsForValuesAffectingIsUncommitted        {return [NSArray arrayWithObject: @"revisions"];}
 
++ (NSArray*) keyPathsForValuesAffectingModifiedRevision {
+    return $array(@"revisions", @"uncommittedRevision.root.isUncommitted");
+}
+
 
 - (NSArray*) revisionsOfFile: (HgFile*)file error: (NSError**)outError
 {

Source/HgRevision.m

     return _shortComment;
 }
 
++ (NSSet*) keyPathsForValuesAffectingShortComment {
+    return [NSSet setWithObject: @"comment"];
+}
+
 
 - (NSString*) description
 {