Mercurial > public > mercurial-scm > hg
comparison mercurial/patch.py @ 10467:16c68fd720ab stable
patch: remove useless copy, cleanup
author | Patrick Mezard <pmezard@gmail.com> |
---|---|
date | Sun, 14 Feb 2010 17:53:23 +0100 |
parents | d1f209bb9564 |
children | a27af7229850 |
comparison
equal
deleted
inserted
replaced
10466:d1f209bb9564 | 10467:16c68fd720ab |
---|---|
1433 revs = [hexfunc(node) for node in [node1, node2] if node] | 1433 revs = [hexfunc(node) for node in [node1, node2] if node] |
1434 | 1434 |
1435 copy = {} | 1435 copy = {} |
1436 if opts.git or opts.upgrade: | 1436 if opts.git or opts.upgrade: |
1437 copy = copies.copies(repo, ctx1, ctx2, repo[nullid])[0] | 1437 copy = copies.copies(repo, ctx1, ctx2, repo[nullid])[0] |
1438 copy = copy.copy() | |
1439 | 1438 |
1440 difffn = lambda opts, losedata: trydiff(repo, revs, ctx1, ctx2, | 1439 difffn = lambda opts, losedata: trydiff(repo, revs, ctx1, ctx2, |
1441 modified, added, removed, copy, getfilectx, opts, losedata) | 1440 modified, added, removed, copy, getfilectx, opts, losedata) |
1442 if opts.upgrade and not opts.git: | 1441 if opts.upgrade and not opts.git: |
1443 try: | 1442 try: |
1515 # regular diffs cannot represent new empty file | 1514 # regular diffs cannot represent new empty file |
1516 losedatafn(f) | 1515 losedatafn(f) |
1517 elif f in removed: | 1516 elif f in removed: |
1518 if opts.git: | 1517 if opts.git: |
1519 # have we already reported a copy above? | 1518 # have we already reported a copy above? |
1520 if f in copy and copy[f] in added and copyto[copy[f]] == f: | 1519 if ((f in copy and copy[f] in added |
1521 dodiff = False | 1520 and copyto[copy[f]] == f) or |
1522 elif f in copyto and copyto[f] in added and copy[copyto[f]] == f: | 1521 (f in copyto and copyto[f] in added |
1522 and copy[copyto[f]] == f)): | |
1523 dodiff = False | 1523 dodiff = False |
1524 else: | 1524 else: |
1525 header.append('deleted file mode %s\n' % | 1525 header.append('deleted file mode %s\n' % |
1526 gitmode[man1.flags(f)]) | 1526 gitmode[man1.flags(f)]) |
1527 elif not to: | 1527 elif not to: |