comparison mercurial/obsutil.py @ 34417:54af8de9bd09

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