merge with stable
authorMatt Mackall <mpm@selenic.com>
Wed, 21 Dec 2011 14:36:08 -0600
changeset 15700 1facaad963a8
parent 15697 21eb048edc19 (current diff)
parent 15699 84e55467093c (diff)
child 15702 64a80204433f
merge with stable
hgext/largefiles/lfutil.py
mercurial/cmdutil.py
--- a/hgext/largefiles/lfutil.py	Mon Dec 19 11:37:44 2011 +0100
+++ b/hgext/largefiles/lfutil.py	Wed Dec 21 14:36:08 2011 -0600
@@ -79,7 +79,7 @@
     except OSError:
         # if hardlinks fail, fallback on atomic copy
         dst = util.atomictempfile(dest)
-        for chunk in util.filechunkiter(open(src)):
+        for chunk in util.filechunkiter(open(src, 'rb')):
             dst.write(chunk)
         dst.close()
         os.chmod(dest, os.stat(src).st_mode)
@@ -238,7 +238,7 @@
         link(usercachepath(repo.ui, hash), storepath(repo, hash))
     else:
         dst = util.atomictempfile(storepath(repo, hash))
-        for chunk in util.filechunkiter(open(file)):
+        for chunk in util.filechunkiter(open(file, 'rb')):
             dst.write(chunk)
         dst.close()
         util.copymode(file, storepath(repo, hash))
--- a/mercurial/cmdutil.py	Mon Dec 19 11:37:44 2011 +0100
+++ b/mercurial/cmdutil.py	Wed Dec 21 14:36:08 2011 -0600
@@ -588,16 +588,17 @@
         ctx1 = repo[node1]
         ctx2 = repo[node2]
         for subpath, sub in subrepo.itersubrepos(ctx1, ctx2):
+            tempnode2 = node2
             try:
                 if node2 is not None:
-                    node2 = ctx2.substate[subpath][1]
+                    tempnode2 = ctx2.substate[subpath][1]
             except KeyError:
                 # A subrepo that existed in node1 was deleted between node1 and
                 # node2 (inclusive). Thus, ctx2's substate won't contain that
                 # subpath. The best we can do is to ignore it.
-                node2 = None
+                tempnode2 = None
             submatch = matchmod.narrowmatcher(subpath, match)
-            sub.diff(diffopts, node2, submatch, changes=changes,
+            sub.diff(diffopts, tempnode2, submatch, changes=changes,
                      stat=stat, fp=fp, prefix=prefix)
 
 class changeset_printer(object):