Mercurial > public > mercurial-scm > hg
comparison mercurial/obsutil.py @ 34418:57980af73cfa
effectflag: detect when branch changed
Store in effect flag when the branch changed between the predecessor and
its successors.
It can happens with "hg branch" + "hg commit --amend", "hg branch" + "hg
amend" or "histedit".
Differential Revision: https://phab.mercurial-scm.org/D538
author | Boris Feld <boris.feld@octobus.net> |
---|---|
date | Thu, 06 Jul 2017 14:55:12 +0200 |
parents | 54af8de9bd09 |
children | fa26f5891e68 |
comparison
equal
deleted
inserted
replaced
34417:54af8de9bd09 | 34418:57980af73cfa |
---|---|
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 USERCHANGED = 1 << 4 # the user changed | 312 USERCHANGED = 1 << 4 # the user changed |
313 DATECHANGED = 1 << 5 # the date changed | 313 DATECHANGED = 1 << 5 # the date changed |
314 BRANCHCHANGED = 1 << 6 # the branch changed | |
314 | 315 |
315 def geteffectflag(relation): | 316 def geteffectflag(relation): |
316 """ From an obs-marker relation, compute what changed between the | 317 """ From an obs-marker relation, compute what changed between the |
317 predecessor and the successor. | 318 predecessor and the successor. |
318 """ | 319 """ |
330 effects |= USERCHANGED | 331 effects |= USERCHANGED |
331 | 332 |
332 # Check if date has changed | 333 # Check if date has changed |
333 if changectx.date() != source.date(): | 334 if changectx.date() != source.date(): |
334 effects |= DATECHANGED | 335 effects |= DATECHANGED |
336 | |
337 # Check if branch has changed | |
338 if changectx.branch() != source.branch(): | |
339 effects |= BRANCHCHANGED | |
335 | 340 |
336 return effects | 341 return effects |
337 | 342 |
338 def getobsoleted(repo, tr): | 343 def getobsoleted(repo, tr): |
339 """return the set of pre-existing revisions obsoleted by a transaction""" | 344 """return the set of pre-existing revisions obsoleted by a transaction""" |