comparison mercurial/localrepo.py @ 21106:53433d8f1faa

localrepo: use commonancestorsheads for checking linear heritage in file commit If two revisions are linearly related, there will only be one ancestor, and commonancestors and commonancestorsheads would give the same result. commonancestorsheads is however slightly simpler, faster and more correct.
author Mads Kiilerich <madski@unity3d.com>
date Thu, 17 Apr 2014 20:01:39 +0200
parents 19b9f23a8c6f
children 4aeb8da68090
comparison
equal deleted inserted replaced
21105:12312f066d93 21106:53433d8f1faa
1166 1166
1167 elif fparent1 == nullid: 1167 elif fparent1 == nullid:
1168 fparent1, fparent2 = fparent2, nullid 1168 fparent1, fparent2 = fparent2, nullid
1169 elif fparent2 != nullid: 1169 elif fparent2 != nullid:
1170 # is one parent an ancestor of the other? 1170 # is one parent an ancestor of the other?
1171 fparentancestors = flog.commonancestors(fparent1, fparent2) 1171 fparentancestors = flog.commonancestorsheads(fparent1, fparent2)
1172 if fparent1 in fparentancestors: 1172 if fparent1 in fparentancestors:
1173 fparent1, fparent2 = fparent2, nullid 1173 fparent1, fparent2 = fparent2, nullid
1174 elif fparent2 in fparentancestors: 1174 elif fparent2 in fparentancestors:
1175 fparent2 = nullid 1175 fparent2 = nullid
1176 1176