# HG changeset patch # User Pulkit Goyal <7895pulkit@gmail.com> # Date 1515674229 -19800 # Node ID 7a322f58fee334ac171ab97d50da858c899903c7 # Parent 43b7773e00ae46d77b7c2b84a6eed06a910a2b26 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]. diff -r 43b7773e00ae -r 7a322f58fee3 hgext3rd/evolve/obshistory.py --- 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):