Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/obsutil.py @ 34420:fa26f5891e68
effectflag: detect when parents changed
Store in effect flag when the parents changed between the predecessor and
its successors.
It can happens with "hg rebase" or "hg grab".
Differential Revision: https://phab.mercurial-scm.org/D539
author | Boris Feld <boris.feld@octobus.net> |
---|---|
date | Thu, 06 Jul 2017 14:56:16 +0200 |
parents | 57980af73cfa |
children | 95759620d492 |
comparison
equal
deleted
inserted
replaced
34419:57980af73cfa | 34420:fa26f5891e68 |
---|---|
307 | 307 |
308 # logic around storing and using effect flags | 308 # logic around storing and using effect flags |
309 EFFECTFLAGFIELD = "ef1" | 309 EFFECTFLAGFIELD = "ef1" |
310 | 310 |
311 DESCCHANGED = 1 << 0 # action changed the description | 311 DESCCHANGED = 1 << 0 # action changed the description |
312 PARENTCHANGED = 1 << 2 # action change the parent | |
312 USERCHANGED = 1 << 4 # the user changed | 313 USERCHANGED = 1 << 4 # the user changed |
313 DATECHANGED = 1 << 5 # the date changed | 314 DATECHANGED = 1 << 5 # the date changed |
314 BRANCHCHANGED = 1 << 6 # the branch changed | 315 BRANCHCHANGED = 1 << 6 # the branch changed |
315 | 316 |
316 def geteffectflag(relation): | 317 def geteffectflag(relation): |
335 effects |= DATECHANGED | 336 effects |= DATECHANGED |
336 | 337 |
337 # Check if branch has changed | 338 # Check if branch has changed |
338 if changectx.branch() != source.branch(): | 339 if changectx.branch() != source.branch(): |
339 effects |= BRANCHCHANGED | 340 effects |= BRANCHCHANGED |
341 | |
342 # Check if at least one of the parent has changed | |
343 if changectx.parents() != source.parents(): | |
344 effects |= PARENTCHANGED | |
340 | 345 |
341 return effects | 346 return effects |
342 | 347 |
343 def getobsoleted(repo, tr): | 348 def getobsoleted(repo, tr): |
344 """return the set of pre-existing revisions obsoleted by a transaction""" | 349 """return the set of pre-existing revisions obsoleted by a transaction""" |