##// END OF EJS Templates
dirstate: fix rebuild; add a test...
Alexis S. L. Carvalho -
r5065:b304c249 default
parent child Browse files
Show More
@@ -0,0 +1,24 b''
1 #!/bin/sh
2 # basic test for hg debugrebuildstate
3
4 hg init repo
5 cd repo
6
7 touch foo bar
8 hg ci -Am 'add foo bar'
9
10 touch baz
11 hg add baz
12 hg rm bar
13
14 echo '% state dump'
15 hg debugstate | cut -b 1-16,35- | sort
16 echo '% status'
17 hg st -A
18
19 hg debugrebuildstate
20 echo '% state dump'
21 hg debugstate | cut -b 1-16,35- | sort
22 echo '% status'
23 hg st -A
24
@@ -0,0 +1,17 b''
1 adding bar
2 adding foo
3 % state dump
4 a 644 0 baz
5 n 644 0 foo
6 r 0 0 bar
7 % status
8 A baz
9 R bar
10 C foo
11 % state dump
12 n 666 -1 bar
13 n 666 -1 foo
14 % status
15 ! bar
16 ? baz
17 C foo
@@ -240,8 +240,14 b' class dirstate(object):'
240 240 self._ui.warn(_("not in dirstate: %s!\n") % f)
241 241 pass
242 242
243 def clear(self):
244 self._map = {}
245 self._copymap = {}
246 self._pl = [nullid, nullid]
247 self.markdirty()
248
243 249 def rebuild(self, parent, files):
244 self.invalidate()
250 self.clear()
245 251 for f in files:
246 252 if files.execf(f):
247 253 self._map[f] = ('n', 0777, -1, 0)
General Comments 0
You need to be logged in to leave comments. Login now