darcs

Issue 336 bug in match name

Title bug in match name
Priority not-our-bug Status resolved
Milestone Resolved in
Superseder Nosy List darcs-devel, dmitry.kurochkin, edwint, granth, kowey, thorkilnaur, tommy, zooko
Assigned To
Topics

Created on 2006-11-08.20:31:59 by zooko, last changed 2009-08-27.13:48:11 by admin.

Messages
msg1186 (view) Author: zooko Date: 2006-11-08.20:31:54
Consider the following two calls (cut-and-pasted from my terminal).

How can the presence of that final "l" make the pattern invalid?

darcs v1.0.8.

Regards,

Zooko

zooko@hanford:~/trees/trunk$ darcs diff -u --match "name \"dbutil: convert ValueError? from DB.l\""

darcs failed:  Couldn't match pattern "name "dbutil: convert ValueError? from DB.l""
zooko@hanford:~/trees/trunk$ darcs diff -u --match "name \"dbutil: convert ValueError? from DB.\""
Tue Nov  7 16:14:39 PST 2006  zooko@zooko.com
  * dbutil: convert ValueError from DB.__len__() into DBError
diff -rN -u old-trunk/trunk/amdlib/util/dbutil.py new-trunk/trunk/amdlib/util/dbutil.py
--- old-trunk/trunk/amdlib/util/dbutil.py       2006-11-08 12:30:29.000000000 -0800
+++ new-trunk/trunk/amdlib/util/dbutil.py       2006-11-08 12:30:30.000000000 -0800
@@ -86,7 +86,13 @@

     @retry
     def __len__(self):
-        return len(self.o)
+        try:
+            return len(self.o)
+        except ValueError, le:
+            # Corrupted db's can sometimes yield this error:
+            # "exceptions.ValueError: __len__() should return >= 0".  Here we
+            # convert those to DBError.
+            raise DBError(le)

     @retry
     def __getitem__(self, i):
msg1187 (view) Author: granth Date: 2006-11-08.20:38:58
The patch name contains "DB.__len__" and you're searching for "DB.l", which
isn't there. You probably meant to put "DB.__l".
msg1188 (view) Author: zooko Date: 2006-11-08.20:47:46
> 
> Grant Husbands <darcsbugs2@grant.x43.net> added the comment:
> 
> The patch name contains "DB.__len__" and you're searching for "DB.l", which
> isn't there. You probably meant to put "DB.__l".

Thanks!
msg1192 (view) Author: edwint Date: 2006-11-09.09:11:08
Zooko wrote:
> How can the presence of that final "l" make the pattern invalid?
>
> zooko@hanford:~/trees/trunk$ darcs diff -u --match "name \"dbutil: convert ValueError? from DB.l\""
> 
> darcs failed:  Couldn't match pattern "name "dbutil: convert ValueError? from DB.l""
> zooko@hanford:~/trees/trunk$ darcs diff -u --match "name \"dbutil: convert ValueError? from DB.\""
> Tue Nov  7 16:14:39 PST 2006  zooko@zooko.com
>   * dbutil: convert ValueError from DB.__len__() into DBError

It looks to me like it's because there's no patch matching the first 
pattern.

Edwin
History
Date User Action Args
2006-11-08 20:31:59zookocreate
2006-11-08 20:39:04granthsetstatus: unread -> wont-fix
nosy: + granth
messages: + msg1187
2006-11-08 20:47:52zookosetnosy: droundy, tommy, kowey, zooko, granth
messages: + msg1188
2006-11-08 21:09:41droundysetstatus: wont-fix -> resolved
nosy: droundy, tommy, kowey, zooko, granth
2006-11-09 09:11:18edwintsetstatus: resolved -> unknown
nosy: + edwint
messages: + msg1192
2006-11-09 09:43:06edwintsetstatus: unknown -> resolved
nosy: droundy, tommy, kowey, zooko, edwint, granth
2009-08-06 17:39:30adminsetnosy: + markstos, jast, Serware, dmitry.kurochkin, darcs-devel, dagit, mornfall, simon, beschmi, thorkilnaur, - droundy, edwint, granth
2009-08-06 20:52:26adminsetnosy: - beschmi
2009-08-10 21:58:26adminsetnosy: + edwint, granth, - markstos, darcs-devel, jast, dagit, Serware, mornfall
2009-08-25 17:53:09adminsetnosy: + darcs-devel, - simon
2009-08-27 13:48:11adminsetnosy: tommy, kowey, darcs-devel, zooko, edwint, granth, thorkilnaur, dmitry.kurochkin