obshistory: pass the csets description in getmarkerdescriptionpatch
Previous patches removed any use of ctx in the function and we now just need the
cset description in the function. Let's pass that only. This will save couple
of calls of repo[node].
--- a/hgext3rd/evolve/obshistory.py Thu Jan 11 17:54:34 2018 +0530
+++ b/hgext3rd/evolve/obshistory.py Thu Jan 11 18:07:09 2018 +0530
@@ -163,13 +163,11 @@
return True, succ
-def getmarkerdescriptionpatch(repo, base, succ):
- basectx = repo[base]
- succctx = repo[succ]
+def getmarkerdescriptionpatch(repo, basedesc, succdesc):
# description are stored without final new line,
# add one to avoid ugly diff
- basedesc = basectx.description() + '\n'
- succdesc = succctx.description() + '\n'
+ basedesc += '\n'
+ succdesc += '\n'
# fake file name
basename = "changeset-description"
@@ -496,13 +494,17 @@
if _patchavailable[0] is True:
succ = _patchavailable[1]
+ basectx = repo[node]
+ succctx = repo[succ]
# Description patch
- descriptionpatch = getmarkerdescriptionpatch(repo, node, succ)
+ descriptionpatch = getmarkerdescriptionpatch(repo,
+ basectx.description(),
+ succctx.description())
if descriptionpatch:
# add the diffheader
diffheader = "diff -r %s -r %s changeset-description\n" % \
- (repo[node], repo[succ])
+ (basectx, succctx)
descriptionpatch = diffheader + descriptionpatch
def tolist(text):