hgext3rd/evolve/obshistory.py
changeset 3402 7a322f58fee3
parent 3401 43b7773e00ae
child 3407 b96568036837
equal deleted inserted replaced
3401:43b7773e00ae 3402:7a322f58fee3
   161     if nodep1 != succp1 or nodep2 != succp2:
   161     if nodep1 != succp1 or nodep2 != succp2:
   162         return False, "changesets rebased"
   162         return False, "changesets rebased"
   163 
   163 
   164     return True, succ
   164     return True, succ
   165 
   165 
   166 def getmarkerdescriptionpatch(repo, base, succ):
   166 def getmarkerdescriptionpatch(repo, basedesc, succdesc):
   167     basectx = repo[base]
       
   168     succctx = repo[succ]
       
   169     # description are stored without final new line,
   167     # description are stored without final new line,
   170     # add one to avoid ugly diff
   168     # add one to avoid ugly diff
   171     basedesc = basectx.description() + '\n'
   169     basedesc += '\n'
   172     succdesc = succctx.description() + '\n'
   170     succdesc += '\n'
   173 
   171 
   174     # fake file name
   172     # fake file name
   175     basename = "changeset-description"
   173     basename = "changeset-description"
   176     succname = "changeset-description"
   174     succname = "changeset-description"
   177 
   175 
   494         _patchavailable = patchavailable(node, repo, marker)
   492         _patchavailable = patchavailable(node, repo, marker)
   495 
   493 
   496         if _patchavailable[0] is True:
   494         if _patchavailable[0] is True:
   497             succ = _patchavailable[1]
   495             succ = _patchavailable[1]
   498 
   496 
       
   497             basectx = repo[node]
       
   498             succctx = repo[succ]
   499             # Description patch
   499             # Description patch
   500             descriptionpatch = getmarkerdescriptionpatch(repo, node, succ)
   500             descriptionpatch = getmarkerdescriptionpatch(repo,
       
   501                                                          basectx.description(),
       
   502                                                          succctx.description())
   501 
   503 
   502             if descriptionpatch:
   504             if descriptionpatch:
   503                 # add the diffheader
   505                 # add the diffheader
   504                 diffheader = "diff -r %s -r %s changeset-description\n" % \
   506                 diffheader = "diff -r %s -r %s changeset-description\n" % \
   505                              (repo[node], repo[succ])
   507                              (basectx, succctx)
   506                 descriptionpatch = diffheader + descriptionpatch
   508                 descriptionpatch = diffheader + descriptionpatch
   507 
   509 
   508                 def tolist(text):
   510                 def tolist(text):
   509                     return [text]
   511                     return [text]
   510 
   512