Mercurial > public > mercurial-scm > hg-stable
comparison mercurial/obsutil.py @ 34416:51aadc0d0da2
effectflag: detect when description changed
Store in effect flag when the description changed between the predecessor and
its successors.
It can happens with "hg commit --amend -e", "hg amend -e" or "histedit".
Differential Revision: https://phab.mercurial-scm.org/D535
author | Boris Feld <boris.feld@octobus.net> |
---|---|
date | Thu, 06 Jul 2017 14:52:34 +0200 |
parents | 014d467f9d08 |
children | 55ef17ec8e59 |
comparison
equal
deleted
inserted
replaced
34415:468646386e95 | 34416:51aadc0d0da2 |
---|---|
306 return set(c.node() for c in foreground) | 306 return set(c.node() for c in foreground) |
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 | |
312 | |
311 def geteffectflag(relation): | 313 def geteffectflag(relation): |
312 """ From an obs-marker relation, compute what changed between the | 314 """ From an obs-marker relation, compute what changed between the |
313 predecessor and the successor. | 315 predecessor and the successor. |
314 """ | 316 """ |
315 effects = 0 | 317 effects = 0 |
316 | 318 |
317 source = relation[0] | 319 source = relation[0] |
320 | |
321 for changectx in relation[1]: | |
322 # Check if description has changed | |
323 if changectx.description() != source.description(): | |
324 effects |= DESCCHANGED | |
318 | 325 |
319 return effects | 326 return effects |
320 | 327 |
321 def getobsoleted(repo, tr): | 328 def getobsoleted(repo, tr): |
322 """return the set of pre-existing revisions obsoleted by a transaction""" | 329 """return the set of pre-existing revisions obsoleted by a transaction""" |