comparison hgext/convert/hg.py @ 5278:70e9a527cc61

convert: avoid dirstate checks; add a test During a conversion, the dirstate contents are not consistent - there are files that may be missing from the dirstate and there may be files that shouldn't be in the dirstate. While this is not fixed, don't mark files as added - put them directly in state 'n'ormal.
author Alexis S. L. Carvalho <alexis@cecm.usp.br>
date Sat, 01 Sep 2007 02:49:18 -0300
parents be4835ad9a85
children 2dbd750b3ddd
comparison
equal deleted inserted replaced
5277:a32a8e50d233 5278:70e9a527cc61
48 return [ hex(x) for x in h ] 48 return [ hex(x) for x in h ]
49 49
50 def putfile(self, f, e, data): 50 def putfile(self, f, e, data):
51 self.repo.wwrite(f, data, e) 51 self.repo.wwrite(f, data, e)
52 if f not in self.repo.dirstate: 52 if f not in self.repo.dirstate:
53 self.repo.dirstate.add(f) 53 self.repo.dirstate.normallookup(f)
54 54
55 def copyfile(self, source, dest): 55 def copyfile(self, source, dest):
56 self.repo.copy(source, dest) 56 self.repo.copy(source, dest)
57 57
58 def delfile(self, f): 58 def delfile(self, f):
109 while parents: 109 while parents:
110 p1 = p2 110 p1 = p2
111 p2 = parents.pop(0) 111 p2 = parents.pop(0)
112 a = self.repo.rawcommit(files, text, commit.author, commit.date, 112 a = self.repo.rawcommit(files, text, commit.author, commit.date,
113 bin(p1), bin(p2), extra=extra) 113 bin(p1), bin(p2), extra=extra)
114 self.repo.dirstate.invalidate() 114 self.repo.dirstate.clear()
115 text = "(octopus merge fixup)\n" 115 text = "(octopus merge fixup)\n"
116 p2 = hg.hex(self.repo.changelog.tip()) 116 p2 = hg.hex(self.repo.changelog.tip())
117 117
118 return p2 118 return p2
119 119