Commits

Jens Alfke  committed 1db5b2f

Detect when the current revision acquires a second parent (happens after a merge) and update the model correctly.

  • Participants
  • Parent commits fdc0323

Comments (0)

Files changed (1)

File Source/HgRepository.m

     int curRevNo, curParent2;
     if( ! [self _getParent1: &curRevNo parent2: &curParent2] )
         return NO;
+    
+    HgRevision *parent2Rev = _uncommittedRevision.parent2;
+    int parent2 = parent2Rev ?parent2Rev.localNumber :-1;
 
     // Run "hg tip" to get tip revision number:
     int tip = [self _getTip];
         [self _checkWorkingTree: &error];
         return YES;
         
-    } else if( curRevNo != _uncommittedRevision.parent.localNumber ) {
-        // A different revision is current!
+    } else if( curRevNo != _uncommittedRevision.parent.localNumber || curParent2 != parent2) {
+        // A different revision is current; or the parents have changed
         [self willChangeValueForKey: @"revisions"];
         _currentRevision = [_revisions objectAtIndex: curRevNo];
         _uncommittedRevision.parent = _currentRevision;