changeset 3165:e43fd1623fe1

fix users of dirstate.copies broken by b1f10d3223c1
author Benoit Boissinot <benoit.boissinot@ens-lyon.org>
date Tue, 26 Sep 2006 13:58:58 +0200
parents ca00ce41a2e8
children 1839e6e91c3a 36ab673f66a5
files mercurial/commands.py mercurial/patch.py
diffstat 2 files changed, 7 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/commands.py	Mon Sep 25 22:26:54 2006 -0500
+++ b/mercurial/commands.py	Tue Sep 26 13:58:58 2006 +0200
@@ -1162,8 +1162,8 @@
                  % (dc[file_][0], dc[file_][1] & 0777, dc[file_][2],
                     time.strftime("%x %X",
                                   time.localtime(dc[file_][3])), file_))
-    for f in repo.dirstate.copies:
-        ui.write(_("copy: %s -> %s\n") % (repo.dirstate.copies[f], f))
+    for f in repo.dirstate.copies():
+        ui.write(_("copy: %s -> %s\n") % (repo.dirstate.copied(f), f))
 
 def debugdata(ui, file_, rev):
     """dump the contents of an data file revision"""
@@ -2472,8 +2472,10 @@
         for f in changes:
             ui.write(format % f)
             if ((all or opts.get('copies')) and not opts.get('no_status')
-                and opt == 'added' and repo.dirstate.copies.has_key(f)):
-                ui.write('  %s%s' % (repo.dirstate.copies[f], end))
+                and opt == 'added'):
+                copied = repo.dirstate.copied(f)
+                if copied:
+                    ui.write('  %s%s' % (copied, end))
 
 def tag(ui, repo, name, rev_=None, **opts):
     """add a tag for the current tip or a given revision
--- a/mercurial/patch.py	Mon Sep 25 22:26:54 2006 -0500
+++ b/mercurial/patch.py	Tue Sep 26 13:58:58 2006 +0200
@@ -433,7 +433,7 @@
         def read(f):
             return repo.wread(f)
         def renamed(f):
-            src = repo.dirstate.copies.get(f)
+            src = repo.dirstate.copied(f)
             parent = repo.dirstate.parents()[0]
             if src:
                 f = src[0]