##// END OF EJS Templates
status: find copies and renames beyond the working directory
Matt Mackall -
r6276:c93ca83a default
parent child Browse files
Show More
@@ -9,7 +9,7 b' from node import hex, nullid, nullrev, s'
9 9 from repo import RepoError
10 10 from i18n import _
11 11 import os, re, sys, urllib
12 import hg, util, revlog, bundlerepo, extensions
12 import hg, util, revlog, bundlerepo, extensions, copies
13 13 import difflib, patch, time, help, mdiff, tempfile
14 14 import version, socket
15 15 import archival, changegroup, cmdutil, hgweb.server, sshserver, hbisect
@@ -2543,6 +2543,22 b' def status(ui, repo, *pats, **opts):'
2543 2543
2544 2544 explicit_changetypes = changetypes + (('clean', 'C', clean),)
2545 2545
2546 copy = {}
2547 showcopy = {}
2548 if ((all or opts.get('copies')) and not opts.get('no_status')):
2549 if opts.get('rev') == []:
2550 # fast path, more correct with merge parents
2551 showcopy = copy = repo.dirstate.copies().copy()
2552 else:
2553 ctxn = repo.changectx(nullid)
2554 ctx1 = repo.changectx(node1)
2555 ctx2 = repo.changectx(node2)
2556 if node2 is None:
2557 ctx2 = repo.workingctx()
2558 copy, diverge = copies.copies(repo, ctx1, ctx2, ctxn)
2559 for k, v in copy.items():
2560 copy[v] = k
2561
2546 2562 end = opts['print0'] and '\0' or '\n'
2547 2563
2548 2564 for opt, char, changes in ([ct for ct in explicit_changetypes
@@ -2556,10 +2572,8 b' def status(ui, repo, *pats, **opts):'
2556 2572
2557 2573 for f in changes:
2558 2574 ui.write(format % repo.pathto(f, cwd))
2559 if ((all or opts.get('copies')) and not opts.get('no_status')):
2560 copied = repo.dirstate.copied(f)
2561 if copied:
2562 ui.write(' %s%s' % (repo.pathto(copied, cwd), end))
2575 if f in copy and (f in added or f in showcopy):
2576 ui.write(' %s%s' % (repo.pathto(copy[f], cwd), end))
2563 2577
2564 2578 def tag(ui, repo, name, rev_=None, **opts):
2565 2579 """add a tag for the current or given revision
General Comments 0
You need to be logged in to leave comments. Login now