changeset 4855:76d4d031cc50

handle nonexistent .hgtags in raw _tag
author Brendan Cully <brendan@kublai.com>
date Wed, 11 Jul 2007 00:34:35 -0700
parents fc389dcc33f5
children 1f3742217a76
files mercurial/localrepo.py
diffstat 1 files changed, 4 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -130,7 +130,10 @@ class localrepository(repo.repository):
         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'])