mercurial/localrepo.py
changeset 4928 2a7d30c97f89
parent 4829 0403b80352c9
child 4929 22fcd6444ad9
equal deleted inserted replaced
4895:fa6c9381d053 4928:2a7d30c97f89
   127         # committed tags are stored in UTF-8
   127         # committed tags are stored in UTF-8
   128         line = '%s %s\n' % (hex(node), util.fromlocal(name))
   128         line = '%s %s\n' % (hex(node), util.fromlocal(name))
   129         if use_dirstate:
   129         if use_dirstate:
   130             self.wfile('.hgtags', 'ab').write(line)
   130             self.wfile('.hgtags', 'ab').write(line)
   131         else:
   131         else:
   132             ntags = self.filectx('.hgtags', parent).data()
   132             try:
       
   133                 ntags = self.filectx('.hgtags', parent).data()
       
   134             except revlog.LookupError:
       
   135                 ntags = ''
   133             self.wfile('.hgtags', 'ab').write(ntags + line)
   136             self.wfile('.hgtags', 'ab').write(ntags + line)
   134         if use_dirstate and self.dirstate.state('.hgtags') == '?':
   137         if use_dirstate and self.dirstate.state('.hgtags') == '?':
   135             self.add(['.hgtags'])
   138             self.add(['.hgtags'])
   136 
   139 
   137         tagnode = self.commit(['.hgtags'], message, user, date, p1=parent)
   140         tagnode = self.commit(['.hgtags'], message, user, date, p1=parent)