mercurial/patch.py
branchstable
changeset 19973 1184edaead7a
parent 19876 7032dcff290c
child 20035 cd79d9ab5e42
equal deleted inserted replaced
19972:1e13a5a9c66e 19973:1184edaead7a
  1701             to = getfilectx(f, ctx1).data()
  1701             to = getfilectx(f, ctx1).data()
  1702         if f not in removed:
  1702         if f not in removed:
  1703             tn = getfilectx(f, ctx2).data()
  1703             tn = getfilectx(f, ctx2).data()
  1704         a, b = f, f
  1704         a, b = f, f
  1705         if opts.git or losedatafn:
  1705         if opts.git or losedatafn:
  1706             if f in added:
  1706             if f in added or (f in modified and to is None):
  1707                 mode = gitmode[ctx2.flags(f)]
  1707                 mode = gitmode[ctx2.flags(f)]
  1708                 if f in copy or f in copyto:
  1708                 if f in copy or f in copyto:
  1709                     if opts.git:
  1709                     if opts.git:
  1710                         if f in copy:
  1710                         if f in copy:
  1711                             a = copy[f]
  1711                             a = copy[f]
  1737                     else:
  1737                     else:
  1738                         losedatafn(f)
  1738                         losedatafn(f)
  1739                 if not opts.git and not tn:
  1739                 if not opts.git and not tn:
  1740                     # regular diffs cannot represent new empty file
  1740                     # regular diffs cannot represent new empty file
  1741                     losedatafn(f)
  1741                     losedatafn(f)
  1742             elif f in removed:
  1742             elif f in removed or (f in modified and tn is None):
  1743                 if opts.git:
  1743                 if opts.git:
  1744                     # have we already reported a copy above?
  1744                     # have we already reported a copy above?
  1745                     if ((f in copy and copy[f] in added
  1745                     if ((f in copy and copy[f] in added
  1746                          and copyto[copy[f]] == f) or
  1746                          and copyto[copy[f]] == f) or
  1747                         (f in copyto and copyto[f] in added
  1747                         (f in copyto and copyto[f] in added