merge with stable
authorMatt Mackall <mpm@selenic.com>
Thu, 03 May 2012 16:12:52 -0500
changeset 16576 eab32ab5cd65
parent 16569 d7c9976b930e (current diff)
parent 16575 91323a78aac2 (diff)
child 16578 43fb170a23bd
merge with stable
--- a/.hgsigs	Wed May 02 13:20:06 2012 +0200
+++ b/.hgsigs	Thu May 03 16:12:52 2012 -0500
@@ -53,3 +53,4 @@
 b9bd95e61b49c221c4cca24e6da7c946fc02f992 0 iD8DBQBPeLsIywK+sNU5EO8RAvpNAKCtKe2gitz8dYn52IRF0hFOPCR7AQCfRJL/RWCFweu2T1vH/mUOCf8SXXc=
 d9e2f09d5488c395ae9ddbb320ceacd24757e055 0 iD8DBQBPju/dywK+sNU5EO8RArBYAJ9xtifdbk+hCOJO8OZa4JfHX8OYZQCeKPMBaBWiT8N/WHoOm1XU0q+iono=
 00182b3d087909e3c3ae44761efecdde8f319ef3 0 iD8DBQBPoFhIywK+sNU5EO8RAhzhAKCBj1n2jxPTkZNJJ5pSp3soa+XHIgCgsZZpAQxOpXwCp0eCdNGe0+pmxmg=
+5983de86462c5a9f42a3ad0f5e90ce5b1d221d25 0 iD8DBQBPovNWywK+sNU5EO8RAhgiAJ980T91FdPTRMmVONDhpkMsZwVIMACgg3bKvoWSeuCW28llUhAJtUjrMv0=
--- a/.hgtags	Wed May 02 13:20:06 2012 +0200
+++ b/.hgtags	Thu May 03 16:12:52 2012 -0500
@@ -65,3 +65,4 @@
 b9bd95e61b49c221c4cca24e6da7c946fc02f992 2.1.2
 d9e2f09d5488c395ae9ddbb320ceacd24757e055 2.2-rc
 00182b3d087909e3c3ae44761efecdde8f319ef3 2.2
+5983de86462c5a9f42a3ad0f5e90ce5b1d221d25 2.2.1
--- a/hgext/largefiles/reposetup.py	Wed May 02 13:20:06 2012 +0200
+++ b/hgext/largefiles/reposetup.py	Thu May 03 16:12:52 2012 -0500
@@ -398,10 +398,6 @@
                     if not fstandin.endswith(os.sep):
                         fstandin += os.sep
 
-                    # prevalidate matching standin directories
-                    if util.any(st for st in match._files
-                                   if st.startswith(fstandin)):
-                        continue
                     actualfiles.append(f)
                 match._files = actualfiles
 
--- a/mercurial/bookmarks.py	Wed May 02 13:20:06 2012 +0200
+++ b/mercurial/bookmarks.py	Thu May 03 16:12:52 2012 -0500
@@ -7,7 +7,7 @@
 
 from mercurial.i18n import _
 from mercurial.node import hex
-from mercurial import encoding, error, util
+from mercurial import encoding, util
 import errno, os
 
 def valid(mark):
@@ -36,7 +36,7 @@
             refspec = encoding.tolocal(refspec)
             try:
                 bookmarks[refspec] = repo.changelog.lookup(sha)
-            except error.RepoLookupError:
+            except LookupError:
                 pass
     except IOError, inst:
         if inst.errno != errno.ENOENT:
--- a/mercurial/help/config.txt	Wed May 02 13:20:06 2012 +0200
+++ b/mercurial/help/config.txt	Thu May 03 16:12:52 2012 -0500
@@ -1328,6 +1328,15 @@
 ``cache``
     Whether to support caching in hgweb. Defaults to True.
 
+``collapse``
+    With ``descend`` enabled, repositories in subdirectories are shown at
+    a single level alongside repositories in the current path. With
+    ``collapse`` also enabled, repositories residing at a deeper level than
+    the current path are grouped behind navigable directory entries that
+    lead to the locations of these repositories. In effect, this setting
+    collapses each collection of repositories found within a subdirectory
+    into a single entry for that subdirectory. Default is False.
+
 ``contact``
     Name or email address of the person in charge of the repository.
     Defaults to ui.username or ``$EMAIL`` or "unknown" if unset or empty.
--- a/mercurial/parsers.c	Wed May 02 13:20:06 2012 +0200
+++ b/mercurial/parsers.c	Thu May 03 16:12:52 2012 -0500
@@ -470,8 +470,10 @@
 		Py_ssize_t i;
 
 		for (i = 0; i < self->raw_length; i++) {
-			Py_XDECREF(self->cache[i]);
-			self->cache[i] = NULL;
+			if (self->cache[i]) {
+				Py_DECREF(self->cache[i]);
+				self->cache[i] = NULL;
+			}
 		}
 		free(self->cache);
 		self->cache = NULL;
@@ -957,9 +959,19 @@
 	return len;
 }
 
-static int index_real_init(indexObject *self, const char *data, int size,
-			   PyObject *inlined_obj, PyObject *data_obj)
+static int index_init(indexObject *self, PyObject *args)
 {
+	PyObject *data_obj, *inlined_obj;
+	Py_ssize_t size;
+
+	if (!PyArg_ParseTuple(args, "OO", &data_obj, &inlined_obj))
+		return -1;
+	if (!PyString_Check(data_obj)) {
+		PyErr_SetString(PyExc_TypeError, "data is not a string");
+		return -1;
+	}
+	size = PyString_GET_SIZE(data_obj);
+
 	self->inlined = inlined_obj && PyObject_IsTrue(inlined_obj);
 	self->data = data_obj;
 	self->cache = NULL;
@@ -971,7 +983,6 @@
 	self->ntdepth = self->ntsplits = 0;
 	self->ntlookups = self->ntmisses = 0;
 	self->ntrev = -1;
-	Py_INCREF(self->data);
 
 	if (self->inlined) {
 		long len = inline_scan(self, NULL);
@@ -987,27 +998,16 @@
 		self->raw_length = size / 64;
 		self->length = self->raw_length + 1;
 	}
+	Py_INCREF(self->data);
 
 	return 0;
 bail:
 	return -1;
 }
 
-static int index_init(indexObject *self, PyObject *args, PyObject *kwds)
-{
-	const char *data;
-	int size;
-	PyObject *inlined_obj;
-
-	if (!PyArg_ParseTuple(args, "s#O", &data, &size, &inlined_obj))
-		return -1;
-
-	return index_real_init(self, data, size, inlined_obj,
-			       PyTuple_GET_ITEM(args, 0));
-}
-
 static PyObject *index_nodemap(indexObject *self)
 {
+	Py_INCREF(self);
 	return (PyObject *)self;
 }
 
@@ -1106,26 +1106,19 @@
  */
 static PyObject *parse_index2(PyObject *self, PyObject *args)
 {
-	const char *data;
-	int size, ret;
-	PyObject *inlined_obj, *tuple = NULL, *cache = NULL;
+	PyObject *tuple = NULL, *cache = NULL;
 	indexObject *idx;
-
-	if (!PyArg_ParseTuple(args, "s#O", &data, &size, &inlined_obj))
-		return NULL;
+	int ret;
 
 	idx = PyObject_New(indexObject, &indexType);
-
 	if (idx == NULL)
 		goto bail;
 
-	ret = index_real_init(idx, data, size, inlined_obj,
-			      PyTuple_GET_ITEM(args, 0));
-	if (ret)
+	ret = index_init(idx, args);
+	if (ret == -1)
 		goto bail;
 
 	if (idx->inlined) {
-		Py_INCREF(idx->data);
 		cache = Py_BuildValue("iO", 0, idx->data);
 		if (cache == NULL)
 			goto bail;
@@ -1134,8 +1127,6 @@
 		Py_INCREF(cache);
 	}
 
-	Py_INCREF(idx);
-
 	tuple = Py_BuildValue("NN", idx, cache);
 	if (!tuple)
 		goto bail;
--- a/tests/test-bookmarks.t	Wed May 02 13:20:06 2012 +0200
+++ b/tests/test-bookmarks.t	Thu May 03 16:12:52 2012 -0500
@@ -371,3 +371,8 @@
    * Z                         3:125c9a1d6df6
      x  y                      2:db815d6d32e6
 
+test missing revisions
+
+  $ echo "925d80f479bc z" > .hg/bookmarks
+  $ hg book
+  no bookmarks set