##// END OF EJS Templates
fsmonitor: write state with wlock held and dirstate unchanged (issue5581)...
Siddharth Agarwal -
r32815:15e85dde default
parent child Browse files
Show More
@@ -485,17 +485,14 b' def overridestatus('
485 485 else:
486 486 stateunknown = listunknown
487 487
488 if updatestate:
489 ps = poststatus(startclock)
490 self.addpostdsstatus(ps)
491
488 492 r = orig(node1, node2, match, listignored, listclean, stateunknown,
489 493 listsubrepos)
490 494 modified, added, removed, deleted, unknown, ignored, clean = r
491 495
492 if updatestate:
493 notefiles = modified + added + removed + deleted + unknown
494 self._fsmonitorstate.set(
495 self._fsmonitorstate.getlastclock() or startclock,
496 _hashignore(self.dirstate._ignore),
497 notefiles)
498
499 496 if not listunknown:
500 497 unknown = []
501 498
@@ -528,6 +525,17 b' def overridestatus('
528 525 return scmutil.status(
529 526 modified, added, removed, deleted, unknown, ignored, clean)
530 527
528 class poststatus(object):
529 def __init__(self, startclock):
530 self._startclock = startclock
531
532 def __call__(self, wctx, status):
533 clock = wctx.repo()._fsmonitorstate.getlastclock() or self._startclock
534 hashignore = _hashignore(wctx.repo().dirstate._ignore)
535 notefiles = (status.modified + status.added + status.removed +
536 status.deleted + status.unknown)
537 wctx.repo()._fsmonitorstate.set(clock, hashignore, notefiles)
538
531 539 def makedirstate(cls):
532 540 class fsmonitordirstate(cls):
533 541 def _fsmonitorinit(self, fsmonitorstate, watchmanclient):
@@ -157,3 +157,50 b' treated differently in _checklookup() ac'
157 157 a
158 158 $ hg debugdirstate
159 159 n * * * a (glob)
160
161 $ rm b
162
163 Set up a rebase situation for issue5581.
164
165 $ echo c2 > a
166 $ echo c2 > b
167 $ hg add b
168 $ hg commit -m c2
169 created new head
170 $ echo c3 >> a
171 $ hg commit -m c3
172 $ hg update 2
173 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
174 $ echo c4 >> a
175 $ echo c4 >> b
176 $ hg commit -m c4
177 created new head
178
179 Configure a merge tool that runs status in the middle of the rebase.
180
181 $ cat >> $TESTTMP/mergetool-race.sh << EOF
182 > echo "custom merge tool"
183 > printf "c2\nc3\nc4\n" > \$1
184 > hg --cwd $TESTTMP/repo status
185 > echo "custom merge tool end"
186 > EOF
187 $ cat >> $HGRCPATH << EOF
188 > [extensions]
189 > rebase =
190 > [merge-tools]
191 > test.executable=sh
192 > test.args=$TESTTMP/mergetool-race.sh \$output
193 > EOF
194
195 $ hg rebase -s . -d 3 --tool test
196 rebasing 4:b08445fd6b2a "c4" (tip)
197 merging a
198 custom merge tool
199 M a
200 ? a.orig
201 custom merge tool end
202 saved backup bundle to $TESTTMP/repo/.hg/strip-backup/* (glob)
203
204 This hg status should be empty, whether or not fsmonitor is enabled (issue5581).
205
206 $ hg status
General Comments 0
You need to be logged in to leave comments. Login now