Mercurial > hgsubversion
annotate README @ 1233:0d0132cba155
editor: fix edge case with in memory file-store size limit
There are a few cases where we will set a single file into to the
editor's FileStore object more than once. Notably, for copied and
then modified files, we will set it at least twice. Three times if
editing fails (which it can for symlinks).
If we pass the in-memory storage limit in between the first (or second
if editing fails) time we set the file and the last time we set the
file, we will write the data to the in memory store the first time and
the file store the last time. We didn't remove it form the in-memory
store though, and we always prefer reading from the in-memory store.
This means we can sometimes end up with the wrong version of a file.
This is fairly unlikely to happen in normal use since you need to hit
the memory limit between two writes to the store for the same file.
We only write a file multiple times if a) the file (and not one of
it's parent directories) is copied and then modified or b) editing
fails. From what I can tell, it's only common for editing to fail for
symlinks, and they ten to be relatively small data that is unlikely to
push over the limit. Finally, the default limit is 100MB which I
would expect to be most often either well over (source code) or well
under (binaries or automated changes) the size of the changes files in
a single commit.
The easiest way to reproduce this is to set the in-memory cache size
to 0 and then commit a copied and modified symlink. The empty-string
version from the failed editing will be the one that persists. I
happened to stumble upon this while trying (and failing) to test a
bug-fix for a related bug with identical symptoms (empty simlink). I
have seen this in the wild, once, but couldn't reproduce it at the
time. The repo in question is quite large and quite active, so I am
quite confident in my estimation that this is a real, but very rare,
problem.
The test changes attached to this was mneant to test a related bug,
but turned out not to actually cover the bug in question. They did
trigger this bug though, and are worthwhile to test, so I kept them.
author | David Schleimer <dschleimer@fb.com> |
---|---|
date | Mon, 07 Apr 2014 17:51:59 -0700 |
parents | 3df6ed4e7561 |
children | b06be5815692 |
rev | line source |
---|---|
288
982c46e7d167
BitBucket supports having the ReST declaration in a comment.
Augie Fackler <durin42@gmail.com>
parents:
280
diff
changeset
|
1 .. -*-restructuredtext-*- |
3
735fdc6c130a
Change the readme to be reST.
Augie Fackler <durin42@gmail.com>
parents:
2
diff
changeset
|
2 |
192
246ca614f04e
Promote first heading to a real title.
Martin Geisler <mg@daimi.au.dk>
parents:
191
diff
changeset
|
3 ============ |
246ca614f04e
Promote first heading to a real title.
Martin Geisler <mg@daimi.au.dk>
parents:
191
diff
changeset
|
4 hgsubversion |
246ca614f04e
Promote first heading to a real title.
Martin Geisler <mg@daimi.au.dk>
parents:
191
diff
changeset
|
5 ============ |
246ca614f04e
Promote first heading to a real title.
Martin Geisler <mg@daimi.au.dk>
parents:
191
diff
changeset
|
6 |
161
47127255145c
Wrapped long lines in README.
Martin Geisler <mg@daimi.au.dk>
parents:
149
diff
changeset
|
7 hgsubversion is an extension for Mercurial that allows using Mercurial |
47127255145c
Wrapped long lines in README.
Martin Geisler <mg@daimi.au.dk>
parents:
149
diff
changeset
|
8 as a Subversion client. |
0
f2636cfed115
Initial import of hgsubversion into a public repository.
Augie Fackler <durin42@gmail.com>
parents:
diff
changeset
|
9 |
515
9fadbf0686a1
README: updated reason users might want to avoid hgsubversion
Augie Fackler <durin42@gmail.com>
parents:
477
diff
changeset
|
10 At this point, hgsubversion is usable by users reasonably familiar with |
9fadbf0686a1
README: updated reason users might want to avoid hgsubversion
Augie Fackler <durin42@gmail.com>
parents:
477
diff
changeset
|
11 Mercurial as a VCS. It's not recommended to dive into hgsubversion as an |
9fadbf0686a1
README: updated reason users might want to avoid hgsubversion
Augie Fackler <durin42@gmail.com>
parents:
477
diff
changeset
|
12 introduction to Mercurial, since hgsubversion "bends the rules" a little |
9fadbf0686a1
README: updated reason users might want to avoid hgsubversion
Augie Fackler <durin42@gmail.com>
parents:
477
diff
changeset
|
13 and violates some of the typical assumptions of early Mercurial users. |
2
89f88df794d3
Cleanup to 80 columns and add a couple of notes on basic use.
Augie Fackler <durin42@gmail.com>
parents:
0
diff
changeset
|
14 |
5
0548662e2f34
Add a section on installation.
Augie Fackler <durin42@gmail.com>
parents:
4
diff
changeset
|
15 Installation |
0548662e2f34
Add a section on installation.
Augie Fackler <durin42@gmail.com>
parents:
4
diff
changeset
|
16 ------------ |
679
0b4e323ebedd
README: mention Subvertpy.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
662
diff
changeset
|
17 You need to have either have Subversion 1.5 (or later) installed along with |
732
050f03a3bdf5
setup/README: update Subvertpy requirement to 0.7.4.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
679
diff
changeset
|
18 either Subvertpy 0.7.4 (or later) or the Subversion SWIG Python bindings. You |
1039
3df6ed4e7561
drop support for pre-2.0 versions of Mercurial
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
732
diff
changeset
|
19 need Mercurial 2.0 or later. |
5
0548662e2f34
Add a section on installation.
Augie Fackler <durin42@gmail.com>
parents:
4
diff
changeset
|
20 |
0548662e2f34
Add a section on installation.
Augie Fackler <durin42@gmail.com>
parents:
4
diff
changeset
|
21 .. _mercurial: http://selenic.com/repo/hg |
53
b61d49e3f91c
crew-stable does not have what I need after all. Oops.
Augie Fackler <durin42@gmail.com>
parents:
50
diff
changeset
|
22 .. _mercurial-stable: http://selenic.com/repo/hg-stable |
5
0548662e2f34
Add a section on installation.
Augie Fackler <durin42@gmail.com>
parents:
4
diff
changeset
|
23 .. _crew: http://hg.intevation.org/mercurial/crew |
0548662e2f34
Add a section on installation.
Augie Fackler <durin42@gmail.com>
parents:
4
diff
changeset
|
24 .. _crew-stable: http://hg.intevation.org/mercurial/crew-stable |
0548662e2f34
Add a section on installation.
Augie Fackler <durin42@gmail.com>
parents:
4
diff
changeset
|
25 |
161
47127255145c
Wrapped long lines in README.
Martin Geisler <mg@daimi.au.dk>
parents:
149
diff
changeset
|
26 If you are unfamiliar with installing Mercurial extensions, please see |
47127255145c
Wrapped long lines in README.
Martin Geisler <mg@daimi.au.dk>
parents:
149
diff
changeset
|
27 the UsingExtensions_ page in the Mercurial wiki. Look at the example |
47127255145c
Wrapped long lines in README.
Martin Geisler <mg@daimi.au.dk>
parents:
149
diff
changeset
|
28 for specifying an absolute path near the bottom of the page. You want |
47127255145c
Wrapped long lines in README.
Martin Geisler <mg@daimi.au.dk>
parents:
149
diff
changeset
|
29 to give the path to the top level of your clone of this repository. |
5
0548662e2f34
Add a section on installation.
Augie Fackler <durin42@gmail.com>
parents:
4
diff
changeset
|
30 |
477
3855865ba53d
README: update URL to Mercurial wiki
Martin Geisler <mg@lazybytes.net>
parents:
476
diff
changeset
|
31 .. _UsingExtensions: http://mercurial.selenic.com/wiki/UsingExtensions |
5
0548662e2f34
Add a section on installation.
Augie Fackler <durin42@gmail.com>
parents:
4
diff
changeset
|
32 |
161
47127255145c
Wrapped long lines in README.
Martin Geisler <mg@daimi.au.dk>
parents:
149
diff
changeset
|
33 Before using hgsubversion, I *strongly* encourage you to run the |
47127255145c
Wrapped long lines in README.
Martin Geisler <mg@daimi.au.dk>
parents:
149
diff
changeset
|
34 automated tests. Just use nose_ if you have it (or ``easy_install |
47127255145c
Wrapped long lines in README.
Martin Geisler <mg@daimi.au.dk>
parents:
149
diff
changeset
|
35 nose`` if you want it), or use ``python tests/run.py`` to run the |
47127255145c
Wrapped long lines in README.
Martin Geisler <mg@daimi.au.dk>
parents:
149
diff
changeset
|
36 suite with the conventional test runner. Note that because I use nose, |
47127255145c
Wrapped long lines in README.
Martin Geisler <mg@daimi.au.dk>
parents:
149
diff
changeset
|
37 there's a lot of stdout spew in the tests right now. The important |
47127255145c
Wrapped long lines in README.
Martin Geisler <mg@daimi.au.dk>
parents:
149
diff
changeset
|
38 part is that all the tests pass. |
30
9867250e0a4a
Add a segment on running the tests before use.
Augie Fackler <durin42@gmail.com>
parents:
24
diff
changeset
|
39 |
9867250e0a4a
Add a segment on running the tests before use.
Augie Fackler <durin42@gmail.com>
parents:
24
diff
changeset
|
40 .. _nose: http://code.google.com/p/python-nose/ |
9867250e0a4a
Add a segment on running the tests before use.
Augie Fackler <durin42@gmail.com>
parents:
24
diff
changeset
|
41 |
679
0b4e323ebedd
README: mention Subvertpy.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
662
diff
changeset
|
42 You can check that hgsubversion is installed and properly activated using the |
0b4e323ebedd
README: mention Subvertpy.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
662
diff
changeset
|
43 following command:: |
0b4e323ebedd
README: mention Subvertpy.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
662
diff
changeset
|
44 |
0b4e323ebedd
README: mention Subvertpy.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
662
diff
changeset
|
45 $ hg version --svn |
0b4e323ebedd
README: mention Subvertpy.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
662
diff
changeset
|
46 Mercurial Distributed SCM (version ...) |
0b4e323ebedd
README: mention Subvertpy.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
662
diff
changeset
|
47 |
0b4e323ebedd
README: mention Subvertpy.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
662
diff
changeset
|
48 Copyright (C) 2005-2010 Matt Mackall <mpm@selenic.com> and others |
0b4e323ebedd
README: mention Subvertpy.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
662
diff
changeset
|
49 This is free software; see the source for copying conditions. There is NO |
0b4e323ebedd
README: mention Subvertpy.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
662
diff
changeset
|
50 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
0b4e323ebedd
README: mention Subvertpy.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
662
diff
changeset
|
51 |
0b4e323ebedd
README: mention Subvertpy.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
662
diff
changeset
|
52 hgsubversion: ... |
0b4e323ebedd
README: mention Subvertpy.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
662
diff
changeset
|
53 Subversion: ... |
0b4e323ebedd
README: mention Subvertpy.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
662
diff
changeset
|
54 bindings: Subvertpy ... |
0b4e323ebedd
README: mention Subvertpy.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
662
diff
changeset
|
55 |
0b4e323ebedd
README: mention Subvertpy.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
662
diff
changeset
|
56 If your bindings are listed as `SWIG`, please consider installing Subvertpy_. |
0b4e323ebedd
README: mention Subvertpy.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
662
diff
changeset
|
57 |
0b4e323ebedd
README: mention Subvertpy.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
662
diff
changeset
|
58 .. _Subvertpy: http://pypi.python.org/pypi/subvertpy |
0b4e323ebedd
README: mention Subvertpy.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
662
diff
changeset
|
59 |
662
a8d5eec1326b
README: remove usage instructions, and refer to the help topic instead.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
646
diff
changeset
|
60 Further Reading |
a8d5eec1326b
README: remove usage instructions, and refer to the help topic instead.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
646
diff
changeset
|
61 --------------- |
3
735fdc6c130a
Change the readme to be reST.
Augie Fackler <durin42@gmail.com>
parents:
2
diff
changeset
|
62 |
662
a8d5eec1326b
README: remove usage instructions, and refer to the help topic instead.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
646
diff
changeset
|
63 More information on how to use hgsubversion is available from within Mercurial |
a8d5eec1326b
README: remove usage instructions, and refer to the help topic instead.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
646
diff
changeset
|
64 in the `subversion` help topic. To view it, use:: |
3
735fdc6c130a
Change the readme to be reST.
Augie Fackler <durin42@gmail.com>
parents:
2
diff
changeset
|
65 |
662
a8d5eec1326b
README: remove usage instructions, and refer to the help topic instead.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
646
diff
changeset
|
66 $ hg help subversion |
3
735fdc6c130a
Change the readme to be reST.
Augie Fackler <durin42@gmail.com>
parents:
2
diff
changeset
|
67 |
662
a8d5eec1326b
README: remove usage instructions, and refer to the help topic instead.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
646
diff
changeset
|
68 The Restructured Text source for this topic is also available in the file |
a8d5eec1326b
README: remove usage instructions, and refer to the help topic instead.
Dan Villiom Podlaski Christiansen <danchr@gmail.com>
parents:
646
diff
changeset
|
69 ``hgsubverson/help/subversion.rst``. |