diff -r 52c5be55af82 hg
--- a/hg	Thu Apr 30 19:22:06 2009 -0500
+++ b/hg	Sat May 02 13:09:31 2009 -0600
@@ -6,6 +6,9 @@
 #
 # This software may be used and distributed according to the terms of the
 # GNU General Public License version 2, incorporated herein by reference.
+
+import sys
+sys.path.append(r'C:\Users\Jeff\Documents\Repositories\hg')
 
 # enable importing on demand to reduce startup time
 try:
diff -r 52c5be55af82 mercurial/hg.py
--- a/mercurial/hg.py	Thu Apr 30 19:22:06 2009 -0500
+++ b/mercurial/hg.py	Sat May 02 13:09:31 2009 -0600
@@ -171,6 +171,7 @@
         if copy:
             hgdir = os.path.realpath(os.path.join(dest, ".hg"))
             if not os.path.exists(dest):
+                ui.status("%s does not exist; creating\n" % dest)
                 os.mkdir(dest)
             else:
                 # only clean up directories we create ourselves
diff -r 52c5be55af82 mercurial/revlog.py
--- a/mercurial/revlog.py	Thu Apr 30 19:22:06 2009 -0500
+++ b/mercurial/revlog.py	Sat May 02 13:09:31 2009 -0600
@@ -63,7 +63,8 @@
         l.sort()
         s = _sha(l[0])
         s.update(l[1])
-    s.update(text)
+    # CP #22258
+    s.update(str(text))
     return s.digest()
 
 def compress(text):
@@ -88,7 +89,7 @@
         if sum(map(len, p)) < l:
             bin = "".join(p)
     else:
-        bin = _compress(text)
+        bin = _compress(str(text))
     if bin is None or len(bin) > l:
         if text[0] == '\0':
             return ("", text)
@@ -440,8 +441,10 @@
             if len(i) > 0:
                 v = struct.unpack(versionformat, i)[0]
         except IOError, inst:
-            if inst.errno != errno.ENOENT:
-                raise
+            # CP #13702
+            # if inst.errno != errno.ENOENT:
+            #     raise
+            pass
 
         self.version = v
         self._inline = v & REVLOGNGINLINEDATA
@@ -1103,7 +1106,7 @@
             transaction.add(self.indexfile, offset, curr)
             ifh.write(entry)
             ifh.write(data[0])
-            ifh.write(data[1])
+            ifh.write(str(data[1])) # CP #2226
             self.checkinlinesize(transaction, ifh)
 
         self._cache = (node, curr, text)
diff -r 52c5be55af82 mercurial/windows.py
--- a/mercurial/windows.py	Thu Apr 30 19:22:06 2009 -0500
+++ b/mercurial/windows.py	Sat May 02 13:09:31 2009 -0600
@@ -6,7 +6,7 @@
 # GNU General Public License version 2, incorporated herein by reference.
 
 from i18n import _
-import errno, msvcrt, os, osutil, re, sys, error
+import errno, os, osutil, re, sys, error
 nulldev = 'NUL:'
 
 umask = 002
@@ -104,8 +104,9 @@
 def set_binary(fd):
     # When run without console, pipes may expose invalid
     # fileno(), usually set to -1.
-    if hasattr(fd, 'fileno') and fd.fileno() >= 0:
-        msvcrt.setmode(fd.fileno(), os.O_BINARY)
+    #~ if hasattr(fd, 'fileno') and fd.fileno() >= 0:
+        #~ msvcrt.setmode(fd.fileno(), os.O_BINARY)
+    pass
 
 def pconvert(path):
     return '/'.join(path.split(os.sep))
