Commit Graph

15 Commits

Author SHA1 Message Date
Jun Wu
556c49918c fsmonitor: store fsmonitor state in treestate
Summary:
The new treestate was designed to store fsmonitor state. Use it to make
fsmonitor and dirstate state consistent, and avoid fsmonitor state
invalidation.

The "fsmonitor identity" check was removed as we now rely on the dirstate
identity check - dirstate and fsmonitor state must be updated consistently -
both updated or neither updated.

Since this is the first dirstate that tracks "untracked" files, several places
are adjusted (ex. dmap.dropfile, dmap.keys) to take the new untracked files
into consideration.

Reviewed By: wez

Differential Revision: D7909172

fbshipit-source-id: 05fd64b25c67ae4b07bc8cfee2731c748205975e
2018-06-14 21:38:33 -07:00
Jun Wu
d26a9397e6 dirstate: unify format configs
Summary:
Previously, there are 2 configs: `treedirstate.useinnewrepos` and
`format.usetreestate`. They are both related to dirstate format and conflict
with each other. This patch unifies them into a single config
`format.dirstate`.

As we're here, merge `test-fb-hgext-treedirstate-x.t` to `test-dirstate-x.t`
if they were previously copied from `test-dirstate-x.t`

Reviewed By: markbt

Differential Revision: D8393878

fbshipit-source-id: 57abeea22ce732d93205e4d4308923afa90693f4
2018-06-13 18:17:26 -07:00
Jun Wu
992bb85644 treestate: make it an option of dirstate backends
Summary:
Add a config option `format.usetreestate`, which would turn on the new
treestate for new repos.

Treestate does not need manually maintaining "copymap", "otherparentset",
"nonnormalset". The one single tree is the source of truth of everything.
So some code like `copymap.pop` etc. are disabled on treestate path.

Reviewed By: markbt

Differential Revision: D7909175

fbshipit-source-id: 96a405fccd4099cefc152ec17204cb5407efbe7e
2018-06-11 14:32:42 -07:00
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
Augie Fackler
84bc4fa4db tests: update test-dirstate to pass our import checker 2017-08-22 15:50:59 -04:00
Pierre-Yves David
30913031d4 error: get Abort from 'error' instead of 'util'
The home of 'Abort' is 'error' not 'util' however, a lot of code seems to be
confused about that and gives all the credit to 'util' instead of the
hardworking 'error'. In a spirit of equity, we break the cycle of injustice and
give back to 'error' the respect it deserves. And screw that 'util' poser.

For great justice.
2015-10-08 12:55:45 -07:00
Durham Goode
7244e005ee dirstate: add test for exceptions during updates
Adds a test that checks if the working copy parent and the working copy are in a
good state if an exception happens between the time the working copy parent is
set and the time the actual updates are recorded in the dirstate.
2014-09-05 15:36:56 -07:00
Jim Hague
3d040369cd tests: AIX can't handle negative date in test-dirstate.t
test-dirstate.t fails on AIX in the absurd date test. AIX touch errors on
any date prior to 1970. AIX mktime() gives an error on such dates, so the
problem is deeper than touch and attempts to work around touch in Python
failed.

Give up. Add an AIX test to hghave and skip the absurd date test on AIX.
2013-04-30 14:56:33 +01:00
Thomas Arendsen Hein
a7130225a3 test-dirstate: remove test with date larger than 32 bit
When running on a 32bit system or with a touch command that only accepts
32bit dates, the following happened:
$ touch -t 250001011200 a
touch: invalid date format `250001011200'
2012-10-09 12:47:54 +02:00
Matt Mackall
38701c0855 dirstate: handle large dates and times with masking (issue2608)
Dates and times that are outside the 31-bit signed range are now
compared modulo 2^31. This should prevent it from behaving badly with
very large files or corrupt dates while still having a high
probability of detecting changes.
2012-10-08 17:50:42 -05:00
Joshua Redstone
5d6b6b4a44 dirstate: add dir/file collision test
Add a test exercising collisions in add between files and directories of the
same name.
2012-06-27 12:28:26 -07:00
Mads Kiilerich
8c22a0ec28 tests: make (glob) on windows accept \ instead of /
Globbing is usually used for filenames, so on windows it is reasonable and very
convenient that glob patterns accepts '\' or '/' when the pattern specifies
'/'.
2011-11-07 03:25:10 +01:00
Martin Geisler
3d112b3042 tests: added a short description to issue numbers
Many tests already had a short line to describe what IssueXXX is
about. I find that quite useful when reading a test.
2010-09-24 10:13:49 +02:00
Adrian Buehlmann
9aadbce905 tests: combine test-dirstate-future.t
into test-dirstate.t
2010-08-15 18:25:29 +02:00
Adrian Buehlmann
4f46a2e9a0 tests: unify test-dirstatedirs 2010-08-15 18:24:49 +02:00