annotate tests/test-repair-strip.t @ 23923:ab6fd3205dad stable

largefiles: fix commit of a directory with no largefile changes (issue4330) When a directory is named in the commit file list, the previous behavior was to walk the list, and if no normal files in the directory were also named, add the corresponding standin for each largefile in that directory. The directory is then dropped from the list, so that committing a directory with no normal file changes works. It then added the corresponding standin directory for the first largefile seen, by prefixing it with '.hglf/'. The latter is unnecessary since each affected largefile is explicitly referenced by its standin in the list. It also caused an abort if there were no changed largefiles in the directory, because none of its standins changed: abort: .hglf/foo/bar: no match under directory! This list of files is used to tweak a matcher in lfutil.updatestandinsbymatch(), which is what is passed to commit(). The status() call that is ultimately done in the commit code with this matcher seems to have some OS specific differences. It is not necessary to append '.' for Windows to run the largefiles tests cleanly. But if '.' is not added to the list, the match function isn't called on Linux, so status() would miss any normal files that were also in a named directory. The commit then proceeds without those normal files, or says "nothing changed" if there were no changed largefiles in the directory. This is not filesystem specific, as VFAT on Linux had the same behavior as when run on ext4. It is also not an issue with lfilesrepo.status(), since that only calls the overridden implementation when paths are passed to commit. I dont have access to an OS X machine ATM to test there. Maybe there's a better way to do this. But since the standin directory for the first largefile was previously being added, and that caused the same walk in status(), there's no preformance change to this. There is no danger of erroneously committing files in '.', because the original match function is called, and if it fails, the lfutil.updatestandinsbymatch() tweaked matcher only indicates a match if the file is in the list of standins- and '.' never is. The added tests confirm this.
author Matt Harbison <matt_harbison@yahoo.com>
date Sun, 18 Jan 2015 15:15:40 -0500
parents 8fb6844a4ff1
children afb86ee925bf
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
22047
8fb6844a4ff1 tests: change some #ifs to #requires
Matt Mackall <mpm@selenic.com>
parents: 20008
diff changeset
1 #require unix-permissions no-root
14022
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
2
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
3 $ echo "[extensions]" >> $HGRCPATH
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
4 $ echo "mq=">> $HGRCPATH
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
5
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
6 $ teststrip() {
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
7 > hg -q up -C $1
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
8 > echo % before update $1, strip $2
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
9 > hg parents
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
10 > chmod -$3 $4
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
11 > hg strip $2 2>&1 | sed 's/\(bundle\).*/\1/' | sed 's/Permission denied.*\.hg\/store\/\(.*\)/Permission denied \.hg\/store\/\1/'
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
12 > echo % after update $1, strip $2
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
13 > chmod +$3 $4
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
14 > hg verify
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
15 > echo % journal contents
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
16 > if [ -f .hg/store/journal ]; then
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
17 > sed -e 's/\.i[^\n]*/\.i/' .hg/store/journal
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
18 > else
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
19 > echo "(no journal)"
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
20 > fi
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
21 > ls .hg/store/journal >/dev/null 2>&1 && hg recover
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
22 > ls .hg/strip-backup/* >/dev/null 2>&1 && hg unbundle -q .hg/strip-backup/*
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
23 > rm -rf .hg/strip-backup
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
24 > }
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
25
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
26 $ hg init test
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
27 $ cd test
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
28 $ echo a > a
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
29 $ hg -q ci -m "a" -A
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
30 $ echo b > b
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
31 $ hg -q ci -m "b" -A
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
32 $ echo b2 >> b
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
33 $ hg -q ci -m "b2" -A
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
34 $ echo c > c
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
35 $ hg -q ci -m "c" -A
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
36 $ teststrip 0 2 w .hg/store/data/b.i
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
37 % before update 0, strip 2
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
38 changeset: 0:cb9a9f314b8b
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
39 user: test
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
40 date: Thu Jan 01 00:00:00 1970 +0000
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
41 summary: a
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
42
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
43 saved backup bundle
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
44 transaction abort!
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
45 failed to truncate data/b.i
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
46 rollback failed - please run hg recover
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
47 strip failed, full bundle
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
48 abort: Permission denied .hg/store/data/b.i
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
49 % after update 0, strip 2
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
50 abandoned transaction found - run hg recover
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
51 checking changesets
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
52 checking manifests
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
53 crosschecking files in changesets and manifests
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
54 checking files
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
55 b@?: rev 1 points to nonexistent changeset 2
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
56 (expected 1)
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
57 b@?: 736c29771fba not in manifests
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
58 warning: orphan revlog 'data/c.i'
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
59 2 files, 2 changesets, 3 total revisions
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
60 2 warnings encountered!
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
61 2 integrity errors encountered!
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
62 % journal contents
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
63 00changelog.i
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
64 00manifest.i
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
65 data/b.i
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
66 data/c.i
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
67 rolling back interrupted transaction
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
68 checking changesets
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
69 checking manifests
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
70 crosschecking files in changesets and manifests
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
71 checking files
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
72 2 files, 2 changesets, 2 total revisions
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
73 $ teststrip 0 2 r .hg/store/data/b.i
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
74 % before update 0, strip 2
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
75 changeset: 0:cb9a9f314b8b
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
76 user: test
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
77 date: Thu Jan 01 00:00:00 1970 +0000
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
78 summary: a
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
79
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
80 abort: Permission denied .hg/store/data/b.i
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
81 % after update 0, strip 2
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
82 checking changesets
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
83 checking manifests
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
84 crosschecking files in changesets and manifests
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
85 checking files
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
86 3 files, 4 changesets, 4 total revisions
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
87 % journal contents
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
88 (no journal)
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
89 $ teststrip 0 2 w .hg/store/00manifest.i
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
90 % before update 0, strip 2
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
91 changeset: 0:cb9a9f314b8b
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
92 user: test
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
93 date: Thu Jan 01 00:00:00 1970 +0000
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
94 summary: a
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
95
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
96 saved backup bundle
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
97 transaction abort!
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
98 failed to truncate 00manifest.i
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
99 rollback failed - please run hg recover
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
100 strip failed, full bundle
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
101 abort: Permission denied .hg/store/00manifest.i
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
102 % after update 0, strip 2
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
103 abandoned transaction found - run hg recover
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
104 checking changesets
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
105 checking manifests
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
106 manifest@?: rev 2 points to nonexistent changeset 2
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
107 manifest@?: 3362547cdf64 not in changesets
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
108 manifest@?: rev 3 points to nonexistent changeset 3
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
109 manifest@?: 265a85892ecb not in changesets
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
110 crosschecking files in changesets and manifests
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
111 c@3: in manifest but not in changeset
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
112 checking files
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
113 b@?: rev 1 points to nonexistent changeset 2
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
114 (expected 1)
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
115 c@?: rev 0 points to nonexistent changeset 3
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
116 3 files, 2 changesets, 4 total revisions
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
117 1 warnings encountered!
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
118 7 integrity errors encountered!
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
119 (first damaged changeset appears to be 3)
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
120 % journal contents
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
121 00changelog.i
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
122 00manifest.i
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
123 data/b.i
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
124 data/c.i
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
125 rolling back interrupted transaction
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
126 checking changesets
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
127 checking manifests
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
128 crosschecking files in changesets and manifests
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
129 checking files
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
130 2 files, 2 changesets, 2 total revisions
f8e1dc896e5f test-repair-strip: turn into new style test
Patrick Mezard <pmezard@gmail.com>
parents:
diff changeset
131
16913
f2719b387380 tests: add missing trailing 'cd ..'
Mads Kiilerich <mads@kiilerich.com>
parents: 15443
diff changeset
132 $ cd ..