comparison mercurial/localrepo.py @ 5204:6a1d2dd96b8e

abort when adding a file in merged state
author Benoit Boissinot <benoit.boissinot@ens-lyon.org>
date Tue, 21 Aug 2007 02:02:08 +0200
parents 012dbf88b9b2
children 212de429e000
comparison
equal deleted inserted replaced
5203:ce4e67533723 5204:6a1d2dd96b8e
993 "(use 'hg revert %s' to unadd the file)\n") 993 "(use 'hg revert %s' to unadd the file)\n")
994 % (f, f)) 994 % (f, f))
995 if not (stat.S_ISREG(st.st_mode) or stat.S_ISLNK(st.st_mode)): 995 if not (stat.S_ISREG(st.st_mode) or stat.S_ISLNK(st.st_mode)):
996 self.ui.warn(_("%s not added: only files and symlinks " 996 self.ui.warn(_("%s not added: only files and symlinks "
997 "supported currently\n") % f) 997 "supported currently\n") % f)
998 elif self.dirstate[f] in 'an': 998 elif self.dirstate[f] in 'amn':
999 self.ui.warn(_("%s already tracked!\n") % f) 999 self.ui.warn(_("%s already tracked!\n") % f)
1000 else: 1000 else:
1001 self.dirstate.add(f) 1001 self.dirstate.add(f)
1002 finally: 1002 finally:
1003 del wlock 1003 del wlock