Commit Graph

18 Commits

Author SHA1 Message Date
Pierre-Yves David
61ff2e647d transaction: remove the redundant 'onclose' mechanism
It is superseded by the 'addfinalize' function and all its user have been
migrated.
2014-12-04 13:51:41 -08:00
Pierre-Yves David
4b96dc117e fncache: drop dedicated 'onclose' function in favor of 'tr.addfinalize'
Now that we have a shiny generic mechanism, we can use it.
2014-12-04 13:49:45 -08:00
Durham Goode
faf9d65282 transactions: fix hg recover with fncache backups
The transaction backupfiles logic was broken for 'hg recover'.  The file format
is XXX\0XXX\0YYY\0YYY\0 but the parser did a couple things wrong. 1) It went one
step beyond the final \0 and tried to read past the end of the array. 2)
array[i:i+1] returns a single item, instead of two items as intended.

Added a test to catch it, which turns out to be the first actual 'hg recover'
test.
2014-10-20 16:53:56 -07:00
Matt Mackall
c430c94f72 tests: ignore missing file with PYTHONDONTWRITEBYTECODE (issue4239) 2014-06-18 13:47:14 -05:00
Durham Goode
950d3b4dd3 fncache: move fncache writing to be in a transaction
Previously the fncache was written at lock.release time. This meant it was not
tracked by a transaction, and if an error occurred during the fncache write it
would fail to update the fncache, but would not rollback the transaction,
resulting in an fncache that was not in sync with the files on disk (which
causes verify to fail, and causes streaming clones to not copy all the revlogs).

This uses the new transaction backup mechanism to make the fncache transacted.
It also moves the fncache from being written at lock.release time, to being
written at transaction.close time.
2014-03-24 15:42:13 -07:00
Brodie Rao
a446720e09 branchmap: cache open/closed branch head information
This lets us determine the open/closed state of a branch without
reading from the changelog (which can be costly over NFS and/or with
many branches).
2013-09-16 01:08:29 -07:00
Kevin Bullock
93f9cb7f25 filtering: rename filters to their antonyms
Now that changelog filtering is in place, it's become evident that
naming the filters according to the set of revs _not_ included in the
filtered changelog is confusing. This is especially evident in the
collaborative branch cache scheme.

This changes the names of the filters to reflect the revs that _are_
included:

  hidden -> visible
  unserved -> served
  mutable -> immutable
  impactable -> base

repoview.filteredrevs is renamed to filterrevs, so that callers read a
bit more sensibly, e.g.:

  filterrevs('visible') # filter revs according to what's visible
2013-01-13 01:39:16 -06:00
Pierre-Yves David
01b68ae973 branchmap: allow to use cache of subset
Filtered repository are *subset* of unfiltered repository. This means that a
filtered branchmap could be use to compute the unfiltered version.

And filtered version happen to be subset of each other:
- "all() - unserved()" is a subset of "all() - hidden()"
- "all() - hidden()" is a subset of "all()"

This means that branchmap with "unfiltered" filter can be used as a base for
"hidden" branchmap that itself could be used as a base for unfiltered
branchmap.

   unserved < hidden < None

This changeset implements this mechanism. If the on disk branchcache is not valid
we use the branchcache of the nearest subset as base instead of computing it from
scratch. Such fallback can be cascaded multiple time is necessary.

Note that both "hidden" and "unserved" set are a bit volatile. We will add more
stable filtering in next changesets.

This changeset enables collaboration between no filtering and "unserved"
filtering. Fixing performance regression introduced by 7bff5f37cb97
2013-01-07 17:23:25 +01:00
Adrian Buehlmann
0375a75090 test-fncache: enable for Windows
Should also fix
http://hgbuildbot.kublai.com/builders/vfat%20hg%20tests/builds/182
2012-10-03 19:43:10 +02:00
Adrian Buehlmann
a0f0963676 test-fncache: test reserved / long paths
testing the store path encoding with real files
2012-09-19 20:33:20 +02:00
Mads Kiilerich
460db57ad0 localrepo: update branchcache in a more reliable way
test-mq-cache.t did apparently look at stale cache content.

Testing with different locking mechanism happened to update the cache more
frequently and thus caused a test failure.
2012-01-13 02:29:38 +01:00
Pierre-Yves David
0f1186823a phases: set new commit in 1-phase 2011-11-11 00:15:22 +01:00
Pierre-Yves David
75d76cce5b phases: add rollback support 2011-11-07 12:27:25 +01: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
Alexander Solovyov
6240007914 fix bookmarks rollback behavior
Before this patch undo.bookmarks was created on bookmarks write and
not with other transaction-related files. There were two issues: first
is that if you have changed bookmarks few times after a transaction
happened, rollback will give you a state which can point to
non-existing revision. Second is that if you have not changed
bookmarks after a transaction, rollback will touch your state anyway.

This change also adds `localrepo._writejournal` method, which can be
used by other extensions to save their transaction-related backup in
right time.
2011-05-01 13:07:00 +02:00
Adrian Buehlmann
bc22fa379c tests: sort fncache 2011-01-28 13:54:38 +01:00
Matt Mackall
08439e0f2d tests: add exit codes to unified tests 2010-09-16 17:51:32 -05:00
Adrian Buehlmann
f964ea4371 tests: unify test-fncache 2010-08-12 17:30:12 +02:00