handle nonexistent .hgtags in raw _tag
authorBrendan Cully <brendan@kublai.com>
Wed, 11 Jul 2007 00:34:35 -0700
changeset 4865 76d4d031cc50
parent 4864 fc389dcc33f5
child 4866 1f3742217a76
handle nonexistent .hgtags in raw _tag
mercurial/localrepo.py
--- a/mercurial/localrepo.py	Wed Jul 11 00:04:15 2007 -0700
+++ b/mercurial/localrepo.py	Wed Jul 11 00:34:35 2007 -0700
@@ -130,7 +130,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'])