Skip to content
Snippets Groups Projects
  • Katsunori FUJIWARA's avatar
    7f569ce3
    keyword: restore kwtemplater.restrict at the end of wrapped patch.diff · 7f569ce3
    Katsunori FUJIWARA authored
    Before this patch, kwdiff doesn't restore kwtemplater.restrict after
    invocation of wrapped patch.diff(). This suppresses keyword expansion
    at subsequent filelog.read().
    
    Typical usecase of this issue is "hg cat" after "hg diff" with command
    server. In this case, kwtemplater.restrict=True is kept in command
    server process even after "hg diff".
    
    To ensure kwtemplater.restrict=True while original patch.diff()
    running, this patch makes kwdiff() yield values returned by it,
    because it returns generator object.
    
    Strictly speaking, if filelog.read() is invoked before completely
    evaluating the result of previous patch.diff(), keyword expansion is
    still suppressed, because kwtemplater.restrict isn't restored yet.
    
    But this fixing should be reasonable enough, because patch.diff() is
    consumed immediately, AFAIK.
    7f569ce3
    History
    keyword: restore kwtemplater.restrict at the end of wrapped patch.diff
    Katsunori FUJIWARA authored
    Before this patch, kwdiff doesn't restore kwtemplater.restrict after
    invocation of wrapped patch.diff(). This suppresses keyword expansion
    at subsequent filelog.read().
    
    Typical usecase of this issue is "hg cat" after "hg diff" with command
    server. In this case, kwtemplater.restrict=True is kept in command
    server process even after "hg diff".
    
    To ensure kwtemplater.restrict=True while original patch.diff()
    running, this patch makes kwdiff() yield values returned by it,
    because it returns generator object.
    
    Strictly speaking, if filelog.read() is invoked before completely
    evaluating the result of previous patch.diff(), keyword expansion is
    still suppressed, because kwtemplater.restrict isn't restored yet.
    
    But this fixing should be reasonable enough, because patch.diff() is
    consumed immediately, AFAIK.