hgext/hgk.py
changeset 3009 abcd6ae3cf5a
parent 2894 75bcb8210a37
child 3056 3dab573a4330
equal deleted inserted replaced
3008:6e49bb42620b 3009:abcd6ae3cf5a
    44     for f in modified:
    44     for f in modified:
    45         to = None
    45         to = None
    46         if f in mmap:
    46         if f in mmap:
    47             to = repo.file(f).read(mmap[f])
    47             to = repo.file(f).read(mmap[f])
    48         tn = read(f)
    48         tn = read(f)
       
    49         opts = mdiff.diffopts()
       
    50         opts.text = text
    49         fp.write("diff --git a/%s b/%s\n" % (f, f))
    51         fp.write("diff --git a/%s b/%s\n" % (f, f))
    50         fp.write(mdiff.unidiff(to, date1, tn, date2, f, None, text=text))
    52         fp.write(mdiff.unidiff(to, date1, tn, date2, f, None, opts=opts))
    51     for f in added:
    53     for f in added:
    52         to = None
    54         to = None
    53         tn = read(f)
    55         tn = read(f)
    54         fp.write("diff --git /dev/null b/%s\n" % (f))
    56         fp.write("diff --git /dev/null b/%s\n" % (f))
    55         fp.write(mdiff.unidiff(to, date1, tn, date2, f, None, text=text))
    57         fp.write(mdiff.unidiff(to, date1, tn, date2, f, None, opts=opts))
    56     for f in removed:
    58     for f in removed:
    57         to = repo.file(f).read(mmap[f])
    59         to = repo.file(f).read(mmap[f])
    58         tn = None
    60         tn = None
    59         fp.write("diff --git a/%s /dev/null\n" % (f))
    61         fp.write("diff --git a/%s /dev/null\n" % (f))
    60         fp.write(mdiff.unidiff(to, date1, tn, date2, f, None, text=text))
    62         fp.write(mdiff.unidiff(to, date1, tn, date2, f, None, opts=opts))
    61 
    63 
    62 def difftree(ui, repo, node1=None, node2=None, **opts):
    64 def difftree(ui, repo, node1=None, node2=None, **opts):
    63     """diff trees from two commits"""
    65     """diff trees from two commits"""
    64     def __difftree(repo, node1, node2):
    66     def __difftree(repo, node1, node2):
    65         def date(c):
    67         def date(c):