handle nonexistent .hgtags in raw _tag
authorBrendan Cully <brendan@kublai.com>
Wed, 11 Jul 2007 00:34:35 -0700
changeset 4928 2a7d30c97f89
parent 4895 fa6c9381d053
child 4929 22fcd6444ad9
handle nonexistent .hgtags in raw _tag
mercurial/localrepo.py
--- a/mercurial/localrepo.py	Tue Jul 17 09:08:29 2007 -0300
+++ b/mercurial/localrepo.py	Wed Jul 11 00:34:35 2007 -0700
@@ -129,7 +129,10 @@
         if use_dirstate:
             self.wfile('.hgtags', 'ab').write(line)
         else:
-            ntags = self.filectx('.hgtags', parent).data()
+            try:
+                ntags = self.filectx('.hgtags', parent).data()
+            except revlog.LookupError:
+                ntags = ''
             self.wfile('.hgtags', 'ab').write(ntags + line)
         if use_dirstate and self.dirstate.state('.hgtags') == '?':
             self.add(['.hgtags'])