Mercurial > hg > mercurial-crew-with-dirclash
comparison mercurial/revlog.py @ 451:c9d134165392
Make lookup a bit smarter
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Make lookup a bit smarter
Handle overflow error
Handle "0000" -> nullid, not 0
manifest hash: f3af0c171216687c621fd0214efe45775e5a1d34
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)
iD8DBQFCu2PrywK+sNU5EO8RArqWAJ9hafXgnHjCDE/Sxtvyo+e+qmPaGgCfR8AV
DCG3i0NasG3ItbPvux2Dm5Q=
=zjqN
-----END PGP SIGNATURE-----
author | mpm@selenic.com |
---|---|
date | Thu, 23 Jun 2005 17:37:47 -0800 |
parents | 024ee0f8722a |
children | e205194ca7ef |
comparison
equal
deleted
inserted
replaced
450:9d785fd7deec | 451:c9d134165392 |
---|---|
190 return c | 190 return c |
191 | 191 |
192 def lookup(self, id): | 192 def lookup(self, id): |
193 try: | 193 try: |
194 rev = int(id) | 194 rev = int(id) |
195 if str(rev) != id: raise "mismatch" | |
195 return self.node(rev) | 196 return self.node(rev) |
196 except ValueError: | 197 except: |
197 c = [] | 198 c = [] |
198 for n in self.nodemap: | 199 for n in self.nodemap: |
199 if id in hex(n): | 200 if id in hex(n): |
200 c.append(n) | 201 c.append(n) |
201 if len(c) > 1: raise KeyError("Ambiguous identifier") | 202 if len(c) > 1: raise KeyError("Ambiguous identifier") |