annotate tests/test-commit-multiple.t @ 39764:e4e881572382

localrepo: iteratively derive local repository type This commit implements the dynamic local repository type derivation that was explained in the recent commit bfeab472e3c0 "localrepo: create new function for instantiating a local repo object." Instead of a static localrepository class/type which must be customized after construction, we now dynamically construct a type by building up base classes/types to represent specific repository interfaces. Conceptually, the end state is similar to what was happening when various extensions would monkeypatch the __class__ of newly-constructed repo instances. However, the approach is inverted. Instead of making the instance then customizing it, we do the customization up front by influencing the behavior of the type then we instantiate that custom type. This approach gives us much more flexibility. For example, we can use completely separate classes for implementing different aspects of the repository. For example, we could have one class representing revlog-based file storage and another representing non-revlog based file storage. When then choose which implementation to use based on the presence of repo requirements. A concern with this approach is that it creates a lot more types and complexity and that complexity adds overhead. Yes, it is true that this approach will result in more types being created. Yes, this is more complicated than traditional "instantiate a static type." However, I believe the alternatives to supporting alternate storage backends are just as complicated. (Before I arrived at this solution, I had patches storing factory functions on local repo instances for e.g. constructing a file storage instance. We ended up having a handful of these. And this was logically identical to assigning custom methods. Since we were logically changing the type of the instance, I figured it would be better to just use specialized types instead of introducing levels of abstraction at run-time.) On the performance front, I don't believe that having N base classes has any significant performance overhead compared to just a single base class. Intuition says that Python will need to iterate the base classes to find an attribute. However, CPython caches method lookups: as long as the __class__ or MRO isn't changing, method attribute lookup should be constant time after first access. And non-method attributes are stored in __dict__, of which there is only 1 per object, so the number of base classes for __dict__ is irrelevant. Anyway, this commit splits up the monolithic completelocalrepository interface into sub-interfaces: 1 for file storage and 1 representing everything else. We've taught ``makelocalrepository()`` to call a series of factory functions which will produce types implementing specific interfaces. It then calls type() to create a new type from the built-up list of base types. This commit should be considered a start and not the end state. I suspect we'll hit a number of problems as we start to implement alternate storage backends: * Passing custom arguments to __init__ and setting custom attributes on __dict__. * Customizing the set of interfaces that are needed. e.g. the "readonly" intent could translate to not requesting an interface providing methods related to writing. * More ergonomic way for extensions to insert themselves so their callbacks aren't unconditionally called. * Wanting to modify vfs instances, other arguments passed to __init__. That being said, this code is usable in its current state and I'm convinced future commits will demonstrate the value in this approach. Differential Revision: https://phab.mercurial-scm.org/D4642
author Gregory Szorc <gregory.szorc@gmail.com>
date Tue, 18 Sep 2018 15:29:42 -0700
parents 5abc47d4ca6b
children ef6cab7930b3
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
13704
a464763e99f1 dirstate: avoid a race with multiple commits in the same process
Greg Ward <greg@gerg.ca>
parents:
diff changeset
1 # reproduce issue2264, issue2516
a464763e99f1 dirstate: avoid a race with multiple commits in the same process
Greg Ward <greg@gerg.ca>
parents:
diff changeset
2
a464763e99f1 dirstate: avoid a race with multiple commits in the same process
Greg Ward <greg@gerg.ca>
parents:
diff changeset
3 create test repo
a464763e99f1 dirstate: avoid a race with multiple commits in the same process
Greg Ward <greg@gerg.ca>
parents:
diff changeset
4 $ cat <<EOF >> $HGRCPATH
a464763e99f1 dirstate: avoid a race with multiple commits in the same process
Greg Ward <greg@gerg.ca>
parents:
diff changeset
5 > [extensions]
a464763e99f1 dirstate: avoid a race with multiple commits in the same process
Greg Ward <greg@gerg.ca>
parents:
diff changeset
6 > transplant =
a464763e99f1 dirstate: avoid a race with multiple commits in the same process
Greg Ward <greg@gerg.ca>
parents:
diff changeset
7 > EOF
a464763e99f1 dirstate: avoid a race with multiple commits in the same process
Greg Ward <greg@gerg.ca>
parents:
diff changeset
8 $ hg init repo
a464763e99f1 dirstate: avoid a race with multiple commits in the same process
Greg Ward <greg@gerg.ca>
parents:
diff changeset
9 $ cd repo
a464763e99f1 dirstate: avoid a race with multiple commits in the same process
Greg Ward <greg@gerg.ca>
parents:
diff changeset
10 $ template="{rev} {desc|firstline} [{branch}]\n"
a464763e99f1 dirstate: avoid a race with multiple commits in the same process
Greg Ward <greg@gerg.ca>
parents:
diff changeset
11
a464763e99f1 dirstate: avoid a race with multiple commits in the same process
Greg Ward <greg@gerg.ca>
parents:
diff changeset
12 # we need to start out with two changesets on the default branch
a464763e99f1 dirstate: avoid a race with multiple commits in the same process
Greg Ward <greg@gerg.ca>
parents:
diff changeset
13 # in order to avoid the cute little optimization where transplant
a464763e99f1 dirstate: avoid a race with multiple commits in the same process
Greg Ward <greg@gerg.ca>
parents:
diff changeset
14 # pulls rather than transplants
a464763e99f1 dirstate: avoid a race with multiple commits in the same process
Greg Ward <greg@gerg.ca>
parents:
diff changeset
15 add initial changesets
a464763e99f1 dirstate: avoid a race with multiple commits in the same process
Greg Ward <greg@gerg.ca>
parents:
diff changeset
16 $ echo feature1 > file1
a464763e99f1 dirstate: avoid a race with multiple commits in the same process
Greg Ward <greg@gerg.ca>
parents:
diff changeset
17 $ hg ci -Am"feature 1"
a464763e99f1 dirstate: avoid a race with multiple commits in the same process
Greg Ward <greg@gerg.ca>
parents:
diff changeset
18 adding file1
a464763e99f1 dirstate: avoid a race with multiple commits in the same process
Greg Ward <greg@gerg.ca>
parents:
diff changeset
19 $ echo feature2 >> file2
a464763e99f1 dirstate: avoid a race with multiple commits in the same process
Greg Ward <greg@gerg.ca>
parents:
diff changeset
20 $ hg ci -Am"feature 2"
a464763e99f1 dirstate: avoid a race with multiple commits in the same process
Greg Ward <greg@gerg.ca>
parents:
diff changeset
21 adding file2
a464763e99f1 dirstate: avoid a race with multiple commits in the same process
Greg Ward <greg@gerg.ca>
parents:
diff changeset
22
a464763e99f1 dirstate: avoid a race with multiple commits in the same process
Greg Ward <greg@gerg.ca>
parents:
diff changeset
23 # The changes to 'bugfix' are enough to show the bug: in fact, with only
a464763e99f1 dirstate: avoid a race with multiple commits in the same process
Greg Ward <greg@gerg.ca>
parents:
diff changeset
24 # those changes, it's a very noisy crash ("RuntimeError: nothing
a464763e99f1 dirstate: avoid a race with multiple commits in the same process
Greg Ward <greg@gerg.ca>
parents:
diff changeset
25 # committed after transplant"). But if we modify a second file in the
a464763e99f1 dirstate: avoid a race with multiple commits in the same process
Greg Ward <greg@gerg.ca>
parents:
diff changeset
26 # transplanted changesets, the bug is much more subtle: transplant
a464763e99f1 dirstate: avoid a race with multiple commits in the same process
Greg Ward <greg@gerg.ca>
parents:
diff changeset
27 # silently drops the second change to 'bugfix' on the floor, and we only
a464763e99f1 dirstate: avoid a race with multiple commits in the same process
Greg Ward <greg@gerg.ca>
parents:
diff changeset
28 # see it when we run 'hg status' after transplanting. Subtle data loss
a464763e99f1 dirstate: avoid a race with multiple commits in the same process
Greg Ward <greg@gerg.ca>
parents:
diff changeset
29 # bugs are worse than crashes, so reproduce the subtle case here.
a464763e99f1 dirstate: avoid a race with multiple commits in the same process
Greg Ward <greg@gerg.ca>
parents:
diff changeset
30 commit bug fixes on bug fix branch
a464763e99f1 dirstate: avoid a race with multiple commits in the same process
Greg Ward <greg@gerg.ca>
parents:
diff changeset
31 $ hg branch fixes
a464763e99f1 dirstate: avoid a race with multiple commits in the same process
Greg Ward <greg@gerg.ca>
parents:
diff changeset
32 marked working directory as branch fixes
15615
41885892796e branch: warn on branching
Matt Mackall <mpm@selenic.com>
parents: 13749
diff changeset
33 (branches are permanent and global, did you want a bookmark?)
13704
a464763e99f1 dirstate: avoid a race with multiple commits in the same process
Greg Ward <greg@gerg.ca>
parents:
diff changeset
34 $ echo fix1 > bugfix
a464763e99f1 dirstate: avoid a race with multiple commits in the same process
Greg Ward <greg@gerg.ca>
parents:
diff changeset
35 $ echo fix1 >> file1
a464763e99f1 dirstate: avoid a race with multiple commits in the same process
Greg Ward <greg@gerg.ca>
parents:
diff changeset
36 $ hg ci -Am"fix 1"
a464763e99f1 dirstate: avoid a race with multiple commits in the same process
Greg Ward <greg@gerg.ca>
parents:
diff changeset
37 adding bugfix
a464763e99f1 dirstate: avoid a race with multiple commits in the same process
Greg Ward <greg@gerg.ca>
parents:
diff changeset
38 $ echo fix2 > bugfix
a464763e99f1 dirstate: avoid a race with multiple commits in the same process
Greg Ward <greg@gerg.ca>
parents:
diff changeset
39 $ echo fix2 >> file1
a464763e99f1 dirstate: avoid a race with multiple commits in the same process
Greg Ward <greg@gerg.ca>
parents:
diff changeset
40 $ hg ci -Am"fix 2"
20117
aa9385f983fa tests: don't load unnecessary graphlog extension
Martin Geisler <martin@geisler.net>
parents: 16913
diff changeset
41 $ hg log -G --template="$template"
13704
a464763e99f1 dirstate: avoid a race with multiple commits in the same process
Greg Ward <greg@gerg.ca>
parents:
diff changeset
42 @ 3 fix 2 [fixes]
a464763e99f1 dirstate: avoid a race with multiple commits in the same process
Greg Ward <greg@gerg.ca>
parents:
diff changeset
43 |
a464763e99f1 dirstate: avoid a race with multiple commits in the same process
Greg Ward <greg@gerg.ca>
parents:
diff changeset
44 o 2 fix 1 [fixes]
a464763e99f1 dirstate: avoid a race with multiple commits in the same process
Greg Ward <greg@gerg.ca>
parents:
diff changeset
45 |
a464763e99f1 dirstate: avoid a race with multiple commits in the same process
Greg Ward <greg@gerg.ca>
parents:
diff changeset
46 o 1 feature 2 [default]
a464763e99f1 dirstate: avoid a race with multiple commits in the same process
Greg Ward <greg@gerg.ca>
parents:
diff changeset
47 |
a464763e99f1 dirstate: avoid a race with multiple commits in the same process
Greg Ward <greg@gerg.ca>
parents:
diff changeset
48 o 0 feature 1 [default]
a464763e99f1 dirstate: avoid a race with multiple commits in the same process
Greg Ward <greg@gerg.ca>
parents:
diff changeset
49
a464763e99f1 dirstate: avoid a race with multiple commits in the same process
Greg Ward <greg@gerg.ca>
parents:
diff changeset
50 transplant bug fixes onto release branch
a464763e99f1 dirstate: avoid a race with multiple commits in the same process
Greg Ward <greg@gerg.ca>
parents:
diff changeset
51 $ hg update 0
a464763e99f1 dirstate: avoid a race with multiple commits in the same process
Greg Ward <greg@gerg.ca>
parents:
diff changeset
52 1 files updated, 0 files merged, 2 files removed, 0 files unresolved
a464763e99f1 dirstate: avoid a race with multiple commits in the same process
Greg Ward <greg@gerg.ca>
parents:
diff changeset
53 $ hg branch release
a464763e99f1 dirstate: avoid a race with multiple commits in the same process
Greg Ward <greg@gerg.ca>
parents:
diff changeset
54 marked working directory as branch release
a464763e99f1 dirstate: avoid a race with multiple commits in the same process
Greg Ward <greg@gerg.ca>
parents:
diff changeset
55 $ hg transplant 2 3
a464763e99f1 dirstate: avoid a race with multiple commits in the same process
Greg Ward <greg@gerg.ca>
parents:
diff changeset
56 applying [0-9a-f]{12} (re)
a464763e99f1 dirstate: avoid a race with multiple commits in the same process
Greg Ward <greg@gerg.ca>
parents:
diff changeset
57 [0-9a-f]{12} transplanted to [0-9a-f]{12} (re)
a464763e99f1 dirstate: avoid a race with multiple commits in the same process
Greg Ward <greg@gerg.ca>
parents:
diff changeset
58 applying [0-9a-f]{12} (re)
a464763e99f1 dirstate: avoid a race with multiple commits in the same process
Greg Ward <greg@gerg.ca>
parents:
diff changeset
59 [0-9a-f]{12} transplanted to [0-9a-f]{12} (re)
20117
aa9385f983fa tests: don't load unnecessary graphlog extension
Martin Geisler <martin@geisler.net>
parents: 16913
diff changeset
60 $ hg log -G --template="$template"
13704
a464763e99f1 dirstate: avoid a race with multiple commits in the same process
Greg Ward <greg@gerg.ca>
parents:
diff changeset
61 @ 5 fix 2 [release]
a464763e99f1 dirstate: avoid a race with multiple commits in the same process
Greg Ward <greg@gerg.ca>
parents:
diff changeset
62 |
a464763e99f1 dirstate: avoid a race with multiple commits in the same process
Greg Ward <greg@gerg.ca>
parents:
diff changeset
63 o 4 fix 1 [release]
a464763e99f1 dirstate: avoid a race with multiple commits in the same process
Greg Ward <greg@gerg.ca>
parents:
diff changeset
64 |
a464763e99f1 dirstate: avoid a race with multiple commits in the same process
Greg Ward <greg@gerg.ca>
parents:
diff changeset
65 | o 3 fix 2 [fixes]
a464763e99f1 dirstate: avoid a race with multiple commits in the same process
Greg Ward <greg@gerg.ca>
parents:
diff changeset
66 | |
a464763e99f1 dirstate: avoid a race with multiple commits in the same process
Greg Ward <greg@gerg.ca>
parents:
diff changeset
67 | o 2 fix 1 [fixes]
a464763e99f1 dirstate: avoid a race with multiple commits in the same process
Greg Ward <greg@gerg.ca>
parents:
diff changeset
68 | |
a464763e99f1 dirstate: avoid a race with multiple commits in the same process
Greg Ward <greg@gerg.ca>
parents:
diff changeset
69 | o 1 feature 2 [default]
a464763e99f1 dirstate: avoid a race with multiple commits in the same process
Greg Ward <greg@gerg.ca>
parents:
diff changeset
70 |/
a464763e99f1 dirstate: avoid a race with multiple commits in the same process
Greg Ward <greg@gerg.ca>
parents:
diff changeset
71 o 0 feature 1 [default]
a464763e99f1 dirstate: avoid a race with multiple commits in the same process
Greg Ward <greg@gerg.ca>
parents:
diff changeset
72
a464763e99f1 dirstate: avoid a race with multiple commits in the same process
Greg Ward <greg@gerg.ca>
parents:
diff changeset
73 $ hg status
a464763e99f1 dirstate: avoid a race with multiple commits in the same process
Greg Ward <greg@gerg.ca>
parents:
diff changeset
74 $ hg status --rev 0:4
a464763e99f1 dirstate: avoid a race with multiple commits in the same process
Greg Ward <greg@gerg.ca>
parents:
diff changeset
75 M file1
a464763e99f1 dirstate: avoid a race with multiple commits in the same process
Greg Ward <greg@gerg.ca>
parents:
diff changeset
76 A bugfix
a464763e99f1 dirstate: avoid a race with multiple commits in the same process
Greg Ward <greg@gerg.ca>
parents:
diff changeset
77 $ hg status --rev 4:5
a464763e99f1 dirstate: avoid a race with multiple commits in the same process
Greg Ward <greg@gerg.ca>
parents:
diff changeset
78 M bugfix
a464763e99f1 dirstate: avoid a race with multiple commits in the same process
Greg Ward <greg@gerg.ca>
parents:
diff changeset
79 M file1
a464763e99f1 dirstate: avoid a race with multiple commits in the same process
Greg Ward <greg@gerg.ca>
parents:
diff changeset
80
a464763e99f1 dirstate: avoid a race with multiple commits in the same process
Greg Ward <greg@gerg.ca>
parents:
diff changeset
81 now test that we fixed the bug for all scripts/extensions
a464763e99f1 dirstate: avoid a race with multiple commits in the same process
Greg Ward <greg@gerg.ca>
parents:
diff changeset
82 $ cat > $TESTTMP/committwice.py <<__EOF__
a464763e99f1 dirstate: avoid a race with multiple commits in the same process
Greg Ward <greg@gerg.ca>
parents:
diff changeset
83 > from mercurial import ui, hg, match, node
13749
8bb03283e9b9 test-commit-multiple.t: improve committwice.py
Adrian Buehlmann <adrian@cadifra.com>
parents: 13704
diff changeset
84 > from time import sleep
13704
a464763e99f1 dirstate: avoid a race with multiple commits in the same process
Greg Ward <greg@gerg.ca>
parents:
diff changeset
85 >
a464763e99f1 dirstate: avoid a race with multiple commits in the same process
Greg Ward <greg@gerg.ca>
parents:
diff changeset
86 > def replacebyte(fn, b):
13749
8bb03283e9b9 test-commit-multiple.t: improve committwice.py
Adrian Buehlmann <adrian@cadifra.com>
parents: 13704
diff changeset
87 > f = open(fn, "rb+")
13704
a464763e99f1 dirstate: avoid a race with multiple commits in the same process
Greg Ward <greg@gerg.ca>
parents:
diff changeset
88 > f.seek(0, 0)
a464763e99f1 dirstate: avoid a race with multiple commits in the same process
Greg Ward <greg@gerg.ca>
parents:
diff changeset
89 > f.write(b)
a464763e99f1 dirstate: avoid a race with multiple commits in the same process
Greg Ward <greg@gerg.ca>
parents:
diff changeset
90 > f.close()
a464763e99f1 dirstate: avoid a race with multiple commits in the same process
Greg Ward <greg@gerg.ca>
parents:
diff changeset
91 >
13749
8bb03283e9b9 test-commit-multiple.t: improve committwice.py
Adrian Buehlmann <adrian@cadifra.com>
parents: 13704
diff changeset
92 > def printfiles(repo, rev):
36785
e2c0c0884b1f py3: make test-commit-multiple.t byte-safe
Yuya Nishihara <yuya@tcha.org>
parents: 33721
diff changeset
93 > repo.ui.status(b"revision %d files: [%s]\n"
e2c0c0884b1f py3: make test-commit-multiple.t byte-safe
Yuya Nishihara <yuya@tcha.org>
parents: 33721
diff changeset
94 > % (rev, b', '.join(b"'%s'" % f
e2c0c0884b1f py3: make test-commit-multiple.t byte-safe
Yuya Nishihara <yuya@tcha.org>
parents: 33721
diff changeset
95 > for f in repo[rev].files())))
13749
8bb03283e9b9 test-commit-multiple.t: improve committwice.py
Adrian Buehlmann <adrian@cadifra.com>
parents: 13704
diff changeset
96 >
36785
e2c0c0884b1f py3: make test-commit-multiple.t byte-safe
Yuya Nishihara <yuya@tcha.org>
parents: 33721
diff changeset
97 > repo = hg.repository(ui.ui.load(), b'.')
13704
a464763e99f1 dirstate: avoid a race with multiple commits in the same process
Greg Ward <greg@gerg.ca>
parents:
diff changeset
98 > assert len(repo) == 6, \
13749
8bb03283e9b9 test-commit-multiple.t: improve committwice.py
Adrian Buehlmann <adrian@cadifra.com>
parents: 13704
diff changeset
99 > "initial: len(repo): %d, expected: 6" % len(repo)
8bb03283e9b9 test-commit-multiple.t: improve committwice.py
Adrian Buehlmann <adrian@cadifra.com>
parents: 13704
diff changeset
100 >
36785
e2c0c0884b1f py3: make test-commit-multiple.t byte-safe
Yuya Nishihara <yuya@tcha.org>
parents: 33721
diff changeset
101 > replacebyte(b"bugfix", b"u")
13749
8bb03283e9b9 test-commit-multiple.t: improve committwice.py
Adrian Buehlmann <adrian@cadifra.com>
parents: 13704
diff changeset
102 > sleep(2)
13704
a464763e99f1 dirstate: avoid a race with multiple commits in the same process
Greg Ward <greg@gerg.ca>
parents:
diff changeset
103 > try:
36785
e2c0c0884b1f py3: make test-commit-multiple.t byte-safe
Yuya Nishihara <yuya@tcha.org>
parents: 33721
diff changeset
104 > repo.ui.status(b"PRE: len(repo): %d\n" % len(repo))
13704
a464763e99f1 dirstate: avoid a race with multiple commits in the same process
Greg Ward <greg@gerg.ca>
parents:
diff changeset
105 > wlock = repo.wlock()
a464763e99f1 dirstate: avoid a race with multiple commits in the same process
Greg Ward <greg@gerg.ca>
parents:
diff changeset
106 > lock = repo.lock()
36785
e2c0c0884b1f py3: make test-commit-multiple.t byte-safe
Yuya Nishihara <yuya@tcha.org>
parents: 33721
diff changeset
107 > replacebyte(b"file1", b"x")
e2c0c0884b1f py3: make test-commit-multiple.t byte-safe
Yuya Nishihara <yuya@tcha.org>
parents: 33721
diff changeset
108 > repo.commit(text=b"x", user=b"test", date=(0, 0))
e2c0c0884b1f py3: make test-commit-multiple.t byte-safe
Yuya Nishihara <yuya@tcha.org>
parents: 33721
diff changeset
109 > replacebyte(b"file1", b"y")
e2c0c0884b1f py3: make test-commit-multiple.t byte-safe
Yuya Nishihara <yuya@tcha.org>
parents: 33721
diff changeset
110 > repo.commit(text=b"y", user=b"test", date=(0, 0))
e2c0c0884b1f py3: make test-commit-multiple.t byte-safe
Yuya Nishihara <yuya@tcha.org>
parents: 33721
diff changeset
111 > repo.ui.status(b"POST: len(repo): %d\n" % len(repo))
13704
a464763e99f1 dirstate: avoid a race with multiple commits in the same process
Greg Ward <greg@gerg.ca>
parents:
diff changeset
112 > finally:
a464763e99f1 dirstate: avoid a race with multiple commits in the same process
Greg Ward <greg@gerg.ca>
parents:
diff changeset
113 > lock.release()
a464763e99f1 dirstate: avoid a race with multiple commits in the same process
Greg Ward <greg@gerg.ca>
parents:
diff changeset
114 > wlock.release()
13749
8bb03283e9b9 test-commit-multiple.t: improve committwice.py
Adrian Buehlmann <adrian@cadifra.com>
parents: 13704
diff changeset
115 > printfiles(repo, 6)
8bb03283e9b9 test-commit-multiple.t: improve committwice.py
Adrian Buehlmann <adrian@cadifra.com>
parents: 13704
diff changeset
116 > printfiles(repo, 7)
13704
a464763e99f1 dirstate: avoid a race with multiple commits in the same process
Greg Ward <greg@gerg.ca>
parents:
diff changeset
117 > __EOF__
39707
5abc47d4ca6b tests: quote PYTHON usage
Matt Harbison <matt_harbison@yahoo.com>
parents: 36785
diff changeset
118 $ "$PYTHON" $TESTTMP/committwice.py
13749
8bb03283e9b9 test-commit-multiple.t: improve committwice.py
Adrian Buehlmann <adrian@cadifra.com>
parents: 13704
diff changeset
119 PRE: len(repo): 6
8bb03283e9b9 test-commit-multiple.t: improve committwice.py
Adrian Buehlmann <adrian@cadifra.com>
parents: 13704
diff changeset
120 POST: len(repo): 8
8bb03283e9b9 test-commit-multiple.t: improve committwice.py
Adrian Buehlmann <adrian@cadifra.com>
parents: 13704
diff changeset
121 revision 6 files: ['bugfix', 'file1']
8bb03283e9b9 test-commit-multiple.t: improve committwice.py
Adrian Buehlmann <adrian@cadifra.com>
parents: 13704
diff changeset
122 revision 7 files: ['file1']
13704
a464763e99f1 dirstate: avoid a race with multiple commits in the same process
Greg Ward <greg@gerg.ca>
parents:
diff changeset
123
a464763e99f1 dirstate: avoid a race with multiple commits in the same process
Greg Ward <greg@gerg.ca>
parents:
diff changeset
124 Do a size-preserving modification outside of that process
a464763e99f1 dirstate: avoid a race with multiple commits in the same process
Greg Ward <greg@gerg.ca>
parents:
diff changeset
125 $ echo abcd > bugfix
a464763e99f1 dirstate: avoid a race with multiple commits in the same process
Greg Ward <greg@gerg.ca>
parents:
diff changeset
126 $ hg status
a464763e99f1 dirstate: avoid a race with multiple commits in the same process
Greg Ward <greg@gerg.ca>
parents:
diff changeset
127 M bugfix
a464763e99f1 dirstate: avoid a race with multiple commits in the same process
Greg Ward <greg@gerg.ca>
parents:
diff changeset
128 $ hg log --template "{rev} {desc} {files}\n" -r5:
a464763e99f1 dirstate: avoid a race with multiple commits in the same process
Greg Ward <greg@gerg.ca>
parents:
diff changeset
129 5 fix 2 bugfix file1
13749
8bb03283e9b9 test-commit-multiple.t: improve committwice.py
Adrian Buehlmann <adrian@cadifra.com>
parents: 13704
diff changeset
130 6 x bugfix file1
13704
a464763e99f1 dirstate: avoid a race with multiple commits in the same process
Greg Ward <greg@gerg.ca>
parents:
diff changeset
131 7 y file1
16913
f2719b387380 tests: add missing trailing 'cd ..'
Mads Kiilerich <mads@kiilerich.com>
parents: 15615
diff changeset
132
f2719b387380 tests: add missing trailing 'cd ..'
Mads Kiilerich <mads@kiilerich.com>
parents: 15615
diff changeset
133 $ cd ..