Mercurial > hg
annotate tests/svn/svndump-tags.sh @ 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 | 965b11c1bd82 |
children |
rev | line source |
---|---|
7475
90d8dfb481e7
Rewrite svn tests using svndump
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
1 #!/bin/sh |
90d8dfb481e7
Rewrite svn tests using svndump
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
2 # |
90d8dfb481e7
Rewrite svn tests using svndump
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
3 # Use this script to generate tags.svndump |
90d8dfb481e7
Rewrite svn tests using svndump
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
4 # |
90d8dfb481e7
Rewrite svn tests using svndump
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
5 |
90d8dfb481e7
Rewrite svn tests using svndump
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
6 mkdir temp |
90d8dfb481e7
Rewrite svn tests using svndump
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
7 cd temp |
90d8dfb481e7
Rewrite svn tests using svndump
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
8 |
90d8dfb481e7
Rewrite svn tests using svndump
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
9 mkdir project-orig |
90d8dfb481e7
Rewrite svn tests using svndump
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
10 cd project-orig |
90d8dfb481e7
Rewrite svn tests using svndump
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
11 mkdir trunk |
90d8dfb481e7
Rewrite svn tests using svndump
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
12 mkdir branches |
90d8dfb481e7
Rewrite svn tests using svndump
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
13 mkdir tags |
90d8dfb481e7
Rewrite svn tests using svndump
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
14 mkdir unrelated |
90d8dfb481e7
Rewrite svn tests using svndump
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
15 cd .. |
90d8dfb481e7
Rewrite svn tests using svndump
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
16 |
90d8dfb481e7
Rewrite svn tests using svndump
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
17 svnadmin create svn-repo |
90d8dfb481e7
Rewrite svn tests using svndump
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
18 svnurl=file://`pwd`/svn-repo |
90d8dfb481e7
Rewrite svn tests using svndump
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
19 svn import project-orig $svnurl -m "init projA" |
90d8dfb481e7
Rewrite svn tests using svndump
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
20 |
90d8dfb481e7
Rewrite svn tests using svndump
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
21 svn co $svnurl project |
90d8dfb481e7
Rewrite svn tests using svndump
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
22 cd project |
90d8dfb481e7
Rewrite svn tests using svndump
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
23 echo a > trunk/a |
90d8dfb481e7
Rewrite svn tests using svndump
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
24 svn add trunk/a |
90d8dfb481e7
Rewrite svn tests using svndump
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
25 svn ci -m adda |
90d8dfb481e7
Rewrite svn tests using svndump
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
26 echo a >> trunk/a |
90d8dfb481e7
Rewrite svn tests using svndump
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
27 svn ci -m changea |
90d8dfb481e7
Rewrite svn tests using svndump
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
28 echo a >> trunk/a |
90d8dfb481e7
Rewrite svn tests using svndump
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
29 svn ci -m changea2 |
90d8dfb481e7
Rewrite svn tests using svndump
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
30 # Add an unrelated commit to test that tags are bound to the |
90d8dfb481e7
Rewrite svn tests using svndump
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
31 # correct "from" revision and not a dummy one |
90d8dfb481e7
Rewrite svn tests using svndump
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
32 echo a >> unrelated/dummy |
90d8dfb481e7
Rewrite svn tests using svndump
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
33 svn add unrelated/dummy |
90d8dfb481e7
Rewrite svn tests using svndump
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
34 svn ci -m unrelatedchange |
90d8dfb481e7
Rewrite svn tests using svndump
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
35 # Tag current revision |
90d8dfb481e7
Rewrite svn tests using svndump
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
36 svn up |
90d8dfb481e7
Rewrite svn tests using svndump
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
37 svn copy trunk tags/trunk.v1 |
90d8dfb481e7
Rewrite svn tests using svndump
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
38 svn copy trunk tags/trunk.badtag |
90d8dfb481e7
Rewrite svn tests using svndump
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
39 svn ci -m "tagging trunk.v1 trunk.badtag" |
90d8dfb481e7
Rewrite svn tests using svndump
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
40 echo a >> trunk/a |
90d8dfb481e7
Rewrite svn tests using svndump
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
41 svn ci -m changea3 |
90d8dfb481e7
Rewrite svn tests using svndump
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
42 # Fix the bad tag |
90d8dfb481e7
Rewrite svn tests using svndump
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
43 # trunk.badtag should not show in converted tags |
90d8dfb481e7
Rewrite svn tests using svndump
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
44 svn up |
90d8dfb481e7
Rewrite svn tests using svndump
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
45 svn mv tags/trunk.badtag tags/trunk.goodtag |
90d8dfb481e7
Rewrite svn tests using svndump
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
46 svn ci -m "fix trunk.badtag" |
8246
965b11c1bd82
convert/svn: keep latest and not oldest tag value
Patrick Mezard <pmezard@gmail.com>
parents:
7475
diff
changeset
|
47 echo a >> trunk/a |
965b11c1bd82
convert/svn: keep latest and not oldest tag value
Patrick Mezard <pmezard@gmail.com>
parents:
7475
diff
changeset
|
48 svn ci -m changea |
965b11c1bd82
convert/svn: keep latest and not oldest tag value
Patrick Mezard <pmezard@gmail.com>
parents:
7475
diff
changeset
|
49 # Delete goodtag and recreate it, to test we pick the good one |
965b11c1bd82
convert/svn: keep latest and not oldest tag value
Patrick Mezard <pmezard@gmail.com>
parents:
7475
diff
changeset
|
50 svn rm tags/trunk.goodtag |
965b11c1bd82
convert/svn: keep latest and not oldest tag value
Patrick Mezard <pmezard@gmail.com>
parents:
7475
diff
changeset
|
51 svn ci -m removegoodtag |
965b11c1bd82
convert/svn: keep latest and not oldest tag value
Patrick Mezard <pmezard@gmail.com>
parents:
7475
diff
changeset
|
52 svn up |
965b11c1bd82
convert/svn: keep latest and not oldest tag value
Patrick Mezard <pmezard@gmail.com>
parents:
7475
diff
changeset
|
53 svn copy trunk tags/trunk.goodtag |
965b11c1bd82
convert/svn: keep latest and not oldest tag value
Patrick Mezard <pmezard@gmail.com>
parents:
7475
diff
changeset
|
54 svn ci -m recreategoodtag |
7475
90d8dfb481e7
Rewrite svn tests using svndump
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
55 cd .. |
90d8dfb481e7
Rewrite svn tests using svndump
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
56 |
90d8dfb481e7
Rewrite svn tests using svndump
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
57 svnadmin dump svn-repo > ../tags.svndump |