Mercurial > public > mercurial-scm > hg
comparison mercurial/context.py @ 47191:b338d831d18c
templates: fix `revset('parents()') % ...` in amend message template
I don't understand why, but putting `revset('parents()') % {desc}` in
the commit message template for amend resulted in a crash because
`memctx.hex()` did `hex(self.node())` and its node was None. This
patch fixes that.
Martin von Zweigbergk <martinvonz@google.com>
Differential Revision: https://phab.mercurial-scm.org/D10707
author | Martin von Zweigbergk <martinvonz@google.com> |
---|---|
date | Tue, 11 May 2021 12:22:26 -0700 |
parents | d55b71393907 |
children | 04d1f17f49e7 |
comparison
equal
deleted
inserted
replaced
47190:294a0aa51b8b | 47191:b338d831d18c |
---|---|
1390 self._extra[b'branch'] = b'default' | 1390 self._extra[b'branch'] = b'default' |
1391 | 1391 |
1392 def __bytes__(self): | 1392 def __bytes__(self): |
1393 return bytes(self._parents[0]) + b"+" | 1393 return bytes(self._parents[0]) + b"+" |
1394 | 1394 |
1395 def hex(self): | |
1396 self._repo.nodeconstants.wdirhex | |
1397 | |
1395 __str__ = encoding.strmethod(__bytes__) | 1398 __str__ = encoding.strmethod(__bytes__) |
1396 | 1399 |
1397 def __nonzero__(self): | 1400 def __nonzero__(self): |
1398 return True | 1401 return True |
1399 | 1402 |