Commit Graph

16 Commits

Author SHA1 Message Date
Mateusz Kwapich
6bc664f630 sqldirstate: change the migration message to be less ugly
Summary: .

Test Plan: works on my sandbox

Reviewers: ttung

Differential Revision: https://phabricator.intern.facebook.com/D3632494
2016-07-28 14:44:56 -07:00
Mateusz Kwapich
08dfb38ce3 sqldirstate: put the fact of enabling sqldirstate into config
Summary: So we can log it to scuba.

Test Plan:
    $ xhg config |grep sql
    extensions.sqldirstate=/data/users/mitrandir/fb-hgext/sqldirstate
    extorder.sqldirstate=sparse
    sqldirstate.skipbackups=True
    sqldirstate.upgrade=True
    sqldirstate.enabled=True

Reviewers: #mercurial, durham, lcharignon, ttung, quark

Reviewed By: quark

Subscribers: quark, mjpieters

Differential Revision: https://phabricator.intern.facebook.com/D3537052

Signature: t1:3537052:1468250378:45217a40cdca66335706ab1bcbb55d8f8389a119
2016-07-11 14:43:14 -07:00
Mateusz Kwapich
7080a2c0c0 sqldirstate: move initialization to extsetup
Summary: That is neccesary for this to work with extorder.

Test Plan: ~/clowncopter/tests/run-tests.py -j 30

Reviewers: #mercurial, ttung, durham, quark

Reviewed By: quark

Subscribers: quark, mjpieters

Differential Revision: https://phabricator.intern.facebook.com/D3472367

Signature: t1:3472367:1466633447:8b5af3f546be9d1f3634882f9638cfe5feb6c181
2016-06-23 11:32:18 -07:00
Martijn Pieters
5b77967854 Backed out changeset 0aa2b8139243
Summary:
The upstream change has now been *properly* landed at
https://selenic.com/repo/hg//rev/6ee50bdeeb32.

Once again, Mea Culpa, yesterday I apparently was in clowntown mode with these
patches.

Test Plan:
Run all affected tests:

  $HGSRC/tests/run-tests.py -l test-pull-createmarkers* test-pushrebase* test-pushvars*

Reviewers: #sourcecontrol, ttung, quark

Reviewed By: quark

Subscribers: mjpieters, durham

Differential Revision: https://phabricator.intern.facebook.com/D3462832

Signature: t1:3462832:1466513182:58d6187c04e0e567a026aba90bf753c76f4949a7

Blame Revision: D3460645
2016-06-21 13:58:55 +01:00
Durham Goode
ec171a5a29 backout: backout e61bd9d5e8ca about file descriptor cache
Summary:
e61bd9d5e8ca requires a change to core that has been accepted but not yet
pushed. This breaks the build, so let's revert it until upstream pushes the
dependency.

Test Plan: Ran the tests

Reviewers: ttung, mjpieters, #sourcecontrol, mitrandir

Reviewed By: mitrandir

Subscribers: mjpieters

Differential Revision: https://phabricator.intern.facebook.com/D3460645

Signature: t1:3460645:1466465904:cd521a989e475f9987237307a7d4d672d58ba615
2016-06-20 16:38:48 -07:00
Martijn Pieters
08afaea81e Get rid of getfilecache now that it is no longer needed
Summary:
Now that my upstream patch for filedescriptor class access has landed the helper function to bypass the descriptor protocol can go altogether.

Depends on D3454878

Test Plan:
Run affected extension tests:

  $HGSRC/tests/run-tests.py -l test-sqldirstate-* test-reflog* test-sparse*

Reviewers: #sourcecontrol, ttung

Subscribers: mjpieters

Differential Revision: https://phabricator.intern.facebook.com/D3456368
2016-06-20 12:12:32 +01:00
Martijn Pieters
9b160b48c6 Use one function to access the filecache descriptor, and wrapfunction to patch
Summary:
There were 3 clowntowny versions of the wrapfiledescriptor function, 2 being
dangerously wrong about how they scan the class hierarchy. All because
`classobj.descriptorname` invokes the descriptor protocol and the filecache
descriptor is not set up for that access.

Instead of one function to do it all, use one utility function to retrieve
the descriptor object from the class __dict__ to avoid the descriptor protocol
kicking in, and use mercurial.extensions.wrapfunction to do the actual
wrapping.

I've sent a patch upstream to fix accessing the filecache descriptor on the
class; if accepted we can drop the getfilecache utility function altogether,
leaving only the wrapfunction calls.

Test Plan:
Run affected extension tests:

   $HGSRC/tests/run-tests.py -l test-sqldirstate-* test-reflog* test-sparse*

Reviewers: #sourcecontrol, ttung

Subscribers: mjpieters

Differential Revision: https://phabricator.intern.facebook.com/D3454878
2016-06-20 12:12:32 +01:00
Mateusz Kwapich
f77bff70e2 sqldirstate: bring back filecache behavior
Summary:
Removing the dirstate file from the filecache file list  broke the dirstate
invalidation on non-sqldirsate repos while the extension is enabled. This is
turining the invalidation on only if we are really working with sqldirstate repo.

Test Plan:
tests didn't catch the broken behaviour - not sure when this would be a problem
in real life. Tests output didn't change.

Reviewers: #mercurial, quark, ttung, lcharignon, durham

Reviewed By: durham

Subscribers: lcharignon, mjpieters

Differential Revision: https://phabricator.intern.facebook.com/D3365711

Signature: t1:3365711:1464738116:4c3446c6900f6b128cbcbd19811b743d3bd3ea06
2016-06-01 09:32:16 -07:00
Mateusz Kwapich
af78d790f7 sqldirstate: write a flat dirstate with just parents for backwards comp
Summary:
This is neccessary for scmprompt to work. I added a config knob because we
may want to disable it if we want to do paranoid mode at some point.

Test Plan: ran tests

Reviewers: #mercurial, durham

Differential Revision: https://phabricator.intern.facebook.com/D3356646
2016-05-27 14:54:48 -07:00
Mateusz Kwapich
82fee7a7a2 sqldirstate: add migration on pull option
Summary: I based my code on the generaldelta upgrade which also occured on pull.

Test Plan: test will follow in next comit

Reviewers: #mercurial, durham, ttung

Subscribers: mjpieters

Differential Revision: https://phabricator.intern.facebook.com/D3356590
2016-05-27 14:54:48 -07:00
Mateusz Kwapich
d19764dd10 sqldirstate: extract the upgrade and downgrade logic
Summary: This is to make implementation of automatic upgrade easier.

Test Plan: Will add a test for it in one of the next diffs

Reviewers: #mercurial, durham, ttung

Subscribers: mjpieters

Differential Revision: https://phabricator.intern.facebook.com/D3356494
2016-05-27 14:54:48 -07:00
Mateusz Kwapich
f2654a8805 sqldirstate: extract method issqldirstate
Summary: I've done it wrong in one place so let's centralize that.

Test Plan: ran tests.

Reviewers: #mercurial, ttung, durham

Subscribers: mjpieters

Differential Revision: https://phabricator.intern.facebook.com/D3354724
2016-05-26 17:33:17 -07:00
Mateusz Kwapich
f932684619 sqldirstate: make shelve work with sqldirstate
Summary:
shelve is woking thanks to the hack where it abandons the transaction but
preserves the dirstate anyway by copying the dirstate to the side and restoring
it. We can do something that works as well and is way faster.

Test Plan:
ran tests
tried it on fbsource - it was nice and fast

Reviewers: #mercurial, ttung, simonfar, durham

Reviewed By: durham

Subscribers: simonfar, mjpieters

Differential Revision: https://phabricator.intern.facebook.com/D3345280

Signature: t1:3345280:1464170069:cfb22b7034f8a8c44fd4284cd35ba17e85dabb99
2016-05-25 14:12:09 -07:00
Mateusz Kwapich
abffbab274 sqldirstate: do not recreate dirstate object on the file change
Summary:
In the dirstate world we don't maintain in-memory cache over dirstate - there
is no need to invalidate it then.

Test Plan: ran mercurial tests with sqldirstate

Reviewers: #mercurial, ttung, durham

Reviewed By: durham

Subscribers: mjpieters

Differential Revision: https://phabricator.intern.facebook.com/D3345268

Signature: t1:3345268:1464169114:e55b709c4acbc89c4e2239f7534c6e13ef9b4861
2016-05-25 14:12:09 -07:00
Mateusz Kwapich
2bc5373ec4 sqldirstate: use the better interface to show supported requirements
Summary: I discovered that mercurial has better mechanics for extensions to use

Test Plan: ran mercurial tests with sqldirstate

Reviewers: #mercurial, durham, ttung, simonfar

Reviewed By: simonfar

Subscribers: simonfar, mjpieters

Differential Revision: https://phabricator.intern.facebook.com/D3345260

Signature: t1:3345260:1464168562:32b09a0f86bc19b8622f8fe51ecb727ef3c44bbc
2016-05-25 14:12:09 -07:00
Mateusz Kwapich
440d3ebb04 sqldirstate: the extension
Summary:
An extension replacing dirstate file with sqlite database so we can have incremental changes and we don't have to read the whole dirstate on every op. This makes sense only when hgwatchan/fsmonitor is on so we don't iterate through whole dirstate.
This is also using the sqlite transactions to handle dirstate transactions instead of copying db around. As a result of that "hg rollback" doesn't work anymore. You can fall back to copying things by setting sqldirstate.skipbackups to False.

Needs those to go to upstream to work: https://phabricator.intern.facebook.com/P56319612
(will send them once the freeze is over)

To use make sure that the extension is loaded *before* hgwatchman (watchman
should be outmost layer).

Test Plan:
Passing all but few mercurial tests (when running with skipbackups=False)
The failures are described in blacklist file.

Reviewers: lcharignon, wez, quark, durham

Reviewed By: durham

Subscribers: laurent, mjpieters, #sourcecontrol

Differential Revision: https://phabricator.intern.facebook.com/D3242547

Signature: t1:3242547:1462577481:fdbfb5287fb8d3e58f7b4d587c01de79ce6b78df
2016-05-06 16:56:45 -07:00