mercurial/localrepo.py
changeset 4909 2a7d30c97f89
parent 4860 0403b80352c9
child 4910 22fcd6444ad9
--- a/mercurial/localrepo.py
+++ b/mercurial/localrepo.py
@@ -129,7 +129,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'])