Merge with TAH
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Merge with TAH
manifest hash: b8ea5be49794773eeb6b8beb712a7c1bd9ed1e9b
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)
iD8DBQFCxPqMywK+sNU5EO8RAn62AJ9nmqCKGck8T4E90V+jljRV56hcHwCff0Co
jTfrJT1oJrGRgd6VE/B4hKc=
=8nW7
-----END PGP SIGNATURE-----
--- a/mercurial/bdiff.c
+++ b/mercurial/bdiff.c
@@ -13,7 +13,12 @@
#include <stdlib.h>
#include <string.h>
#ifdef _WIN32
+#ifdef _MSC_VER
+#define inline __inline
+typedef unsigned long uint32_t;
+#else
#include <stdint.h>
+#endif
static uint32_t htonl(uint32_t x)
{
return ((x & 0x000000ffUL) << 24) |
--- a/mercurial/commands.py
+++ b/mercurial/commands.py
@@ -922,6 +922,11 @@ def dispatch(args):
u.warn("broken pipe\n")
else:
raise
+ except OSError, inst:
+ if hasattr(inst, "filename"):
+ u.warn("abort: %s: %s\n" % (inst.strerror, inst.filename))
+ else:
+ u.warn("abort: %s\n" % inst.strerror)
except TypeError, inst:
# was this an argument error?
tb = traceback.extract_tb(sys.exc_info()[2])
--- a/mercurial/hg.py
+++ b/mercurial/hg.py
@@ -711,8 +711,8 @@ class localrepository:
# do a full compare of any files that might have changed
change = self.changelog.read(self.dirstate.parents()[0])
mf1 = self.manifest.read(change[0])
- for f in lookup:
- if fcmp(f, mf):
+ for f in l:
+ if fcmp(f, mf1):
c.append(f)
return (c, a, d, u)
--- a/mercurial/mpatch.c
+++ b/mercurial/mpatch.c
@@ -24,7 +24,12 @@
#include <stdlib.h>
#include <string.h>
#ifdef _WIN32
+#ifdef _MSC_VER
+#define inline __inline
+typedef unsigned long uint32_t;
+#else
#include <stdint.h>
+#endif
static uint32_t ntohl(uint32_t x)
{
return ((x & 0x000000ffUL) << 24) |
new file mode 100755
--- /dev/null
+++ b/tests/test-clone
@@ -0,0 +1,28 @@
+#!/bin/bash
+
+set -x
+mkdir a
+cd a
+hg init
+echo a > a
+hg add a
+hg commit -t test -u test -d '0 0'
+
+# Default operation
+hg clone . ../b
+cd ../b
+cat a
+hg verify
+
+# No update
+hg clone -U . ../c
+cd ../c
+cat a
+hg verify
+
+# Default destination
+mkdir ../d
+cd ../d
+hg clone ../a
+cd a
+hg cat a
new file mode 100755
--- /dev/null
+++ b/tests/test-clone-failure
@@ -0,0 +1,43 @@
+#!/bin/bash
+
+set -x
+
+# No local source
+hg clone a b
+echo $?
+
+# No remote source
+hg clone http://127.0.0.1:3121/a b
+echo $?
+rm -rf b # work around bug with http clone
+
+# Inaccessible source
+mkdir a
+chmod 000 a
+hg clone a b
+echo $?
+
+# Inaccessible destination
+mkdir b
+cd b
+hg init
+hg clone . ../a
+echo $?
+cd ..
+chmod 700 a
+rm -rf a b
+
+# Source of wrong type
+mkfifo a
+hg clone a b
+echo $?
+rm a
+
+# Default destination, same directory
+mkdir q
+cd q
+hg init
+cd ..
+hg clone q
+
+true
new file mode 100644
--- /dev/null
+++ b/tests/test-clone-failure.out
@@ -0,0 +1,44 @@
++ hg clone a b
+abort: No such file or directory: a
++ echo 255
+255
++ hg clone http://127.0.0.1:3121/a b
+requesting all changes
+adding changesets
+abort: error 111: Connection refused
+transaction abort!
+rollback completed
++ echo 255
+255
++ rm -rf b
++ mkdir a
++ chmod 000 a
++ hg clone a b
+cp: cannot stat `a/.hg': Permission denied
+abort: cp exited with status 1
++ echo 255
+255
++ mkdir b
++ cd b
++ hg init
++ hg clone . ../a
+abort: destination '../a' already exists
++ echo 1
+1
++ cd ..
++ chmod 700 a
++ rm -rf a b
++ mkfifo a
++ hg clone a b
+cp: cannot stat `a/.hg': Not a directory
+abort: cp exited with status 1
++ echo 255
+255
++ rm a
++ mkdir q
++ cd q
++ hg init
++ cd ..
++ hg clone q
+abort: destination 'q' already exists
++ true
new file mode 100644
--- /dev/null
+++ b/tests/test-clone.out
@@ -0,0 +1,32 @@
++ mkdir a
++ cd a
++ hg init
++ echo a
++ hg add a
++ hg commit -t test -u test -d '0 0'
++ hg clone . ../b
++ cd ../b
++ cat a
+a
++ hg verify
+checking changesets
+checking manifests
+crosschecking files in changesets and manifests
+checking files
+1 files, 1 changesets, 1 total revisions
++ hg clone -U . ../c
++ cd ../c
++ cat a
+cat: a: No such file or directory
++ hg verify
+checking changesets
+checking manifests
+crosschecking files in changesets and manifests
+checking files
+1 files, 1 changesets, 1 total revisions
++ mkdir ../d
++ cd ../d
++ hg clone ../a
++ cd a
++ hg cat a
+a