Merge with crew-stable
authorMatt Mackall <mpm@selenic.com>
Thu, 05 Jul 2007 16:15:57 -0500
changeset 4820 8706e75e6431
parent 4819 9797124581c9 (current diff)
parent 4805 beb774707c52 (diff)
child 4821 f48290864625
child 4823 b68b250f9537
Merge with crew-stable
--- a/mercurial/commands.py	Thu Jul 05 16:01:07 2007 -0500
+++ b/mercurial/commands.py	Thu Jul 05 16:15:57 2007 -0500
@@ -2254,7 +2254,7 @@
     directory, the reverted files will thus appear modified
     afterwards.
 
-    If a file has been deleted, it is recreated.  If the executable
+    If a file has been deleted, it is restored.  If the executable
     mode of a file was changed, it is reset.
 
     If names are given, all files matching the names are reverted.
--- a/mercurial/util.py	Thu Jul 05 16:01:07 2007 -0500
+++ b/mercurial/util.py	Thu Jul 05 16:15:57 2007 -0500
@@ -968,6 +968,12 @@
                     return p_name_ext
         return default
 
+    def set_signal_handler():
+        try:
+            set_signal_handler_win32()
+        except NameError:
+            pass
+
     try:
         # override functions with win32 versions if possible
         from util_win32 import *
--- a/mercurial/util_win32.py	Thu Jul 05 16:01:07 2007 -0500
+++ b/mercurial/util_win32.py	Thu Jul 05 16:15:57 2007 -0500
@@ -300,7 +300,7 @@
 
 getuser_fallback = win32api.GetUserName
 
-def set_signal_handler():
+def set_signal_handler_win32():
     """Register a termination handler for console events including
     CTRL+C. python signal handlers do not work well with socket
     operations.
--- a/tests/test-archive	Thu Jul 05 16:01:07 2007 -0500
+++ b/tests/test-archive	Thu Jul 05 16:15:57 2007 -0500
@@ -39,16 +39,22 @@
 hg archive -t tgz -p %b-%h test-%h.tar.gz
 gzip -dc test-$QTIP.tar.gz | tar tf - | sed "s/$QTIP/TIP/"
 
-cat > md5check.py <<EOF
+cat > md5comp.py <<EOF
 import md5, sys
-print md5.md5(file(sys.argv[1], 'rb').read()).hexdigest()
+f1, f2 = sys.argv[1:3]
+h1 = md5.md5(file(f1, 'rb').read()).hexdigest()
+h2 = md5.md5(file(f2, 'rb').read()).hexdigest()
+print h1 == h2 or "md5 differ: " + repr((h1, h2))
 EOF
 
+# archive name is stored in the archive, so create similar
+# archives and rename them afterwards.
 hg archive -t tgz tip.tar.gz
-python md5check.py tip.tar.gz
+mv tip.tar.gz tip1.tar.gz
 sleep 1
 hg archive -t tgz tip.tar.gz
-python md5check.py tip.tar.gz
+mv tip.tar.gz tip2.tar.gz
+python md5comp.py tip1.tar.gz tip2.tar.gz
 
 hg archive -t zip -p /illegal test.zip
 hg archive -t zip -p very/../bad test.zip
--- a/tests/test-archive.out	Thu Jul 05 16:01:07 2007 -0500
+++ b/tests/test-archive.out	Thu Jul 05 16:15:57 2007 -0500
@@ -26,8 +26,7 @@
 test-TIP/bar
 test-TIP/baz/bletch
 test-TIP/foo
-76ce33f5d5cf8151558e2d9a396c7504
-76ce33f5d5cf8151558e2d9a396c7504
+True
 abort: archive prefix contains illegal components
 Archive:  test.zip
     testing: test/.hg_archival.txt    OK
--- a/tests/test-demandimport	Thu Jul 05 16:01:07 2007 -0500
+++ b/tests/test-demandimport	Thu Jul 05 16:15:57 2007 -0500
@@ -8,7 +8,7 @@
 rsub = re.sub
 def f(obj):
     l = repr(obj)
-    l = rsub("0x[0-9a-f]+", "0x?", l)
+    l = rsub("0x[0-9a-fA-F]+", "0x?", l)
     l = rsub("from '.*'", "from '?'", l)
     return l