merge with stable
authorMatt Mackall <mpm@selenic.com>
Sat, 25 Feb 2012 16:48:07 -0600
changeset 16176 0bb0b9f22cd7
parent 16174 0a73c4bd9f47 (current diff)
parent 16175 280e834c9d15 (diff)
child 16177 b8c1a8a57540
merge with stable
mercurial/commands.py
--- a/mercurial/commands.py	Sat Feb 25 22:11:36 2012 +0100
+++ b/mercurial/commands.py	Sat Feb 25 16:48:07 2012 -0600
@@ -3853,9 +3853,11 @@
     limit = cmdutil.loglimit(opts)
     count = 0
 
-    endrev = None
-    if opts.get('copies') and opts.get('rev'):
-        endrev = max(scmutil.revrange(repo, opts.get('rev'))) + 1
+    getrenamed, endrev = None, None
+    if opts.get('copies'):
+        if opts.get('rev'):
+            endrev = max(scmutil.revrange(repo, opts.get('rev'))) + 1
+        getrenamed = templatekw.getrenamedfn(repo, endrev=endrev)
 
     df = False
     if opts["date"]:
@@ -3899,9 +3901,8 @@
                 return
 
         copies = None
-        if opts.get('copies') and rev:
+        if getrenamed is not None and rev:
             copies = []
-            getrenamed = templatekw.getrenamedfn(repo, endrev=endrev)
             for fn in ctx.files():
                 rename = getrenamed(fn, rev)
                 if rename: