##// 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 from repo import RepoError
9 from repo import RepoError
10 from i18n import _
10 from i18n import _
11 import os, re, sys, urllib
11 import os, re, sys, urllib
12 import hg, util, revlog, bundlerepo, extensions
12 import hg, util, revlog, bundlerepo, extensions, copies
13 import difflib, patch, time, help, mdiff, tempfile
13 import difflib, patch, time, help, mdiff, tempfile
14 import version, socket
14 import version, socket
15 import archival, changegroup, cmdutil, hgweb.server, sshserver, hbisect
15 import archival, changegroup, cmdutil, hgweb.server, sshserver, hbisect
@@ -2543,6 +2543,22 b' def status(ui, repo, *pats, **opts):'
2543
2543
2544 explicit_changetypes = changetypes + (('clean', 'C', clean),)
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 end = opts['print0'] and '\0' or '\n'
2562 end = opts['print0'] and '\0' or '\n'
2547
2563
2548 for opt, char, changes in ([ct for ct in explicit_changetypes
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 for f in changes:
2573 for f in changes:
2558 ui.write(format % repo.pathto(f, cwd))
2574 ui.write(format % repo.pathto(f, cwd))
2559 if ((all or opts.get('copies')) and not opts.get('no_status')):
2575 if f in copy and (f in added or f in showcopy):
2560 copied = repo.dirstate.copied(f)
2576 ui.write(' %s%s' % (repo.pathto(copy[f], cwd), end))
2561 if copied:
2562 ui.write(' %s%s' % (repo.pathto(copied, cwd), end))
2563
2577
2564 def tag(ui, repo, name, rev_=None, **opts):
2578 def tag(ui, repo, name, rev_=None, **opts):
2565 """add a tag for the current or given revision
2579 """add a tag for the current or given revision
General Comments 0
You need to be logged in to leave comments. Login now