mercurial/patch.py
changeset 23996 0188c2d90356
parent 23995 d8330fb8c44d
child 23997 8b88870cbd1e
equal deleted inserted replaced
23995:d8330fb8c44d 23996:0188c2d90356
  1805             tn = getfilectx(f, ctx2).data()
  1805             tn = getfilectx(f, ctx2).data()
  1806         a, b = f, f
  1806         a, b = f, f
  1807         if opts.git or losedatafn:
  1807         if opts.git or losedatafn:
  1808             if f in addedset:
  1808             if f in addedset:
  1809                 mode = gitmode[ctx2.flags(f)]
  1809                 mode = gitmode[ctx2.flags(f)]
  1810                 if f in copy or f in copyto:
  1810                 if f in copy:
  1811                     if opts.git:
  1811                     if opts.git:
  1812                         if f in copy:
  1812                         a = copy[f]
  1813                             a = copy[f]
       
  1814                         else:
       
  1815                             a = copyto[f]
       
  1816                         omode = gitmode[ctx1.flags(a)]
  1813                         omode = gitmode[ctx1.flags(a)]
  1817                         addmodehdr(header, omode, mode)
  1814                         addmodehdr(header, omode, mode)
  1818                         if a in removedset and a not in gone:
  1815                         if a in removedset and a not in gone:
  1819                             op = 'rename'
  1816                             op = 'rename'
  1820                             gone.add(a)
  1817                             gone.add(a)
  1839                     # regular diffs cannot represent new empty file
  1836                     # regular diffs cannot represent new empty file
  1840                     losedatafn(f)
  1837                     losedatafn(f)
  1841             elif f in removedset:
  1838             elif f in removedset:
  1842                 if opts.git:
  1839                 if opts.git:
  1843                     # have we already reported a copy above?
  1840                     # have we already reported a copy above?
  1844                     if ((f in copy and copy[f] in addedset
  1841                     if (f in copyto and copyto[f] in addedset
  1845                          and copyto[copy[f]] == f) or
  1842                         and copy[copyto[f]] == f):
  1846                         (f in copyto and copyto[f] in addedset
       
  1847                          and copy[copyto[f]] == f)):
       
  1848                         continue
  1843                         continue
  1849                     else:
  1844                     else:
  1850                         header.append('deleted file mode %s\n' %
  1845                         header.append('deleted file mode %s\n' %
  1851                                       gitmode[ctx1.flags(f)])
  1846                                       gitmode[ctx1.flags(f)])
  1852                         if util.binary(to):
  1847                         if util.binary(to):