Commit Graph

15 Commits

Author SHA1 Message Date
Matt Harbison
7d8bebd9c1 tests: remove (glob) annotations that were only for '\' matches
# skip-blame because this was mechanically rewritten the following script.  I
ran it on both *.t and *.py, but none of the *.py changes were proper.  All *.t
ones appear to be, and they run without addition failures on both Windows and
Linux.

  import argparse
  import os
  import re

  ap = argparse.ArgumentParser()
  ap.add_argument('path', nargs='+')
  opts = ap.parse_args()

  globre = re.compile(r'^(.*) \(glob\)(.*)$')

  for p in opts.path:
      tmp = p + '.tmp'
      with open(p, 'rb') as src, open(tmp, 'wb') as dst:
          for line in src:
              m = globre.match(line)
              if not m or '$LOCALIP' in line or '*' in line:
                  dst.write(line)
                  continue
              if '?' in line[:-3] or ('?' in line[:-3] and line[-3:] != '(?)'):
                  dst.write(line)
                  continue
              dst.write(m.group(1) + m.group(2) + '\n')
      os.unlink(p)
      os.rename(tmp, p)
2017-12-10 22:50:57 -05:00
Siddharth Agarwal
71d0912db5 test-dirstate-race: hide irrelevant hg status output
See the explanation for more.

Differential Revision: https://phab.mercurial-scm.org/D153
2017-07-20 18:04:21 -07:00
Martin von Zweigbergk
3ce6c1796d merge with stable 2017-06-29 15:21:52 -07:00
Siddharth Agarwal
41dae969eb status: don't crash if a lookup file disappears
This can happen if another process (even another hg process!) comes along and
removes the file at that time.

This partly resolves issue5584, but not completely -- a bogus dirstate update
can still happen. However, the full fix is too involved for stable.
2017-06-02 22:27:52 -07:00
Matt Harbison
5c7fd6ce49 test-dirstate-race: stabilize for Windows
Without quoting, the output after "custom merge tool" in the next test is an
abort trying to open "C:UsersMattAppData..."
2017-06-14 23:56:58 -04:00
Siddharth Agarwal
d3ed1149d0 fsmonitor: don't write out state if identity has changed (issue5581)
Inspired by the dirstate fix in 39954a8760cd, this should fix any race
conditions with the fsmonitor state changing from underneath.

Since we now grab the wlock for any non-invalidate writes, the only situation
this appears to happen in is with a concurrent invalidation. Test that.
2017-06-12 15:34:31 -07:00
Siddharth Agarwal
0015087fea fsmonitor: write state with wlock held and dirstate unchanged (issue5581)
This means that the state will not be written if:

(1) either the wlock can't be obtained
(2) something else came along and changed the dirstate while we were in the
middle of a status run.
2017-06-12 15:34:31 -07:00
Siddharth Agarwal
05506e53ba workingctx: factor out post-status dirstate fixup
We want to allow extensions to be able to add code to run inside the wlock.
2017-06-12 13:54:59 -07:00
Siddharth Agarwal
0741933c16 test-dirstate-race: back out changeset 7f1ac0997ccd
This is non-deterministic. In any case, I switched to using
debugrebuilddirstate in my WIP patches, which makes this moot.
2017-06-12 13:10:09 -07:00
Siddharth Agarwal
6e165aa389 test-dirstate-race: ensure that a isn't in the lookup set at the end
We're going to rely on this in upcoming patches.
2017-06-10 14:07:31 -07:00
FUJIWARA Katsunori
457ca6840f context: avoid writing outdated dirstate out (issue5584)
Before this patch, workingctx.status() may cause writing outdated
dirstate out, if:

  - .hg/dirstate is changed simultaneously after last loading it,
  - there is any file, which should be dirstate.normal()-ed

Typical issue case is:

  - the working directory is updated by "hg update"
  - .hg/dirstate is updated in background (e.g. fsmonitor)

This patch compares identities of dirstate before and after
acquisition of wlock, and avoids writing outdated dirstate out, if
change of .hg/dirstate is detected.
2017-06-09 13:07:49 +09:00
FUJIWARA Katsunori
72d07d2573 tests: factor external procedures out for portability
Fortunately, "&&" is treated as "execute next, if previous doesn't
fail" both on POSIX and Windows. But keeping portability of
"dirstaterace.command" manually is troublesome.

This patch factors external procedures out as a shell script for
portability. "sh SCRIPT" always allows scripting in POSIX style.

This change is also for convenience. Fixed script name can reduce
command line arguments.

"r" prefix is needed for "sh '$TESTTMP/dirstaterace.sh'", because
$TESTTMP contains backslash on Windows.
2017-06-09 13:07:49 +09:00
Matt Harbison
d898f4f6e4 tests: adjust recent output changes for Windows 2017-06-04 20:11:59 -04:00
Sune Foldager
843894f4b3 tests: remove exec bit from .t files 2010-09-14 16:03:10 +02:00
Adrian Buehlmann
79059e20c1 combine tests 2010-09-14 12:20:51 +02:00