comparison mercurial/obsutil.py @ 34416:55ef17ec8e59

effectflag: detect when user changed Store in effect flag when the user changed between the predecessor and its successors. It can happens with "hg commit --amend -u" or "histedit". Differential Revision: https://phab.mercurial-scm.org/D536
author Boris Feld <boris.feld@octobus.net>
date Thu, 06 Jul 2017 14:53:48 +0200
parents 51aadc0d0da2
children 54af8de9bd09
comparison
equal deleted inserted replaced
34415:51aadc0d0da2 34416:55ef17ec8e59
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 USERCHANGED = 1 << 4 # the user changed
312 313
313 def geteffectflag(relation): 314 def geteffectflag(relation):
314 """ From an obs-marker relation, compute what changed between the 315 """ From an obs-marker relation, compute what changed between the
315 predecessor and the successor. 316 predecessor and the successor.
316 """ 317 """
320 321
321 for changectx in relation[1]: 322 for changectx in relation[1]:
322 # Check if description has changed 323 # Check if description has changed
323 if changectx.description() != source.description(): 324 if changectx.description() != source.description():
324 effects |= DESCCHANGED 325 effects |= DESCCHANGED
326
327 # Check if user has changed
328 if changectx.user() != source.user():
329 effects |= USERCHANGED
325 330
326 return effects 331 return effects
327 332
328 def getobsoleted(repo, tr): 333 def getobsoleted(repo, tr):
329 """return the set of pre-existing revisions obsoleted by a transaction""" 334 """return the set of pre-existing revisions obsoleted by a transaction"""