Patchwork [3,of,5] lazymanifest: fail if path or hash strings cannot be created

login
register
mail settings
Submitter Martin von Zweigbergk
Date March 11, 2015, 11:14 p.m.
Message ID <91e8436e566b285254d1.1426115665@martinvonz.mtv.corp.google.com>
Download mbox | patch
Permalink /patch/8011/
State Superseded
Commit 30e9ee2038462725f706e14819a799ceedefcb71
Headers show

Comments

Martin von Zweigbergk - March 11, 2015, 11:14 p.m.
# HG changeset patch
# User Martin von Zweigbergk <martinvonz@google.com>
# Date 1426106134 25200
#      Wed Mar 11 13:35:34 2015 -0700
# Node ID 91e8436e566b285254d11aec6dc6694ae50ff6e8
# Parent  7daaf234ddc08ee8dd171a6c2d3347e0caf1632e
lazymanifest: fail if path or hash strings cannot be created

While generating (path, hash, flags), we fail if flags cannot be
created. We should also fail if path or hash cannot be created.
Matt Mackall - March 12, 2015, 10:53 p.m.
On Wed, 2015-03-11 at 16:14 -0700, Martin von Zweigbergk wrote:
> # HG changeset patch
> # User Martin von Zweigbergk <martinvonz@google.com>
> # Date 1426106134 25200
> #      Wed Mar 11 13:35:34 2015 -0700
> # Node ID 91e8436e566b285254d11aec6dc6694ae50ff6e8
> # Parent  7daaf234ddc08ee8dd171a6c2d3347e0caf1632e
> lazymanifest: fail if path or hash strings cannot be created

Seems to be a victim of the previous patch.

I've queued the first patch, thanks.

Patch

diff -r 7daaf234ddc0 -r 91e8436e566b mercurial/manifest.c
--- a/mercurial/manifest.c	Wed Mar 11 13:26:36 2015 -0700
+++ b/mercurial/manifest.c	Wed Mar 11 13:35:34 2015 -0700
@@ -243,7 +243,7 @@ 
 	consumed = pl + 41;
 	flags = PyString_FromStringAndSize(l->start + consumed,
 									   l->len - consumed - 1);
-	if (flags) {
+	if (path && hash && flags) {
 		return PyTuple_Pack(3, path, hash, flags);
 	} else {
 		Py_XDECREF(path);