Mercurial > hg
annotate tests/svn/svndump-encoding.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 | 0332f8b44e54 |
children | f3398f1f70a0 |
rev | line source |
---|---|
8882
48a04961b0dd
convert/svn: remove useless encoding/decoding calls (issue1676)
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
1 # -*- coding: utf-8 -*- |
48a04961b0dd
convert/svn: remove useless encoding/decoding calls (issue1676)
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
2 #!/bin/sh |
48a04961b0dd
convert/svn: remove useless encoding/decoding calls (issue1676)
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
3 # |
48a04961b0dd
convert/svn: remove useless encoding/decoding calls (issue1676)
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
4 # Use this script to generate encoding.svndump |
48a04961b0dd
convert/svn: remove useless encoding/decoding calls (issue1676)
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
5 # |
48a04961b0dd
convert/svn: remove useless encoding/decoding calls (issue1676)
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
6 |
48a04961b0dd
convert/svn: remove useless encoding/decoding calls (issue1676)
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
7 mkdir temp |
48a04961b0dd
convert/svn: remove useless encoding/decoding calls (issue1676)
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
8 cd temp |
48a04961b0dd
convert/svn: remove useless encoding/decoding calls (issue1676)
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
9 |
48a04961b0dd
convert/svn: remove useless encoding/decoding calls (issue1676)
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
10 mkdir project-orig |
48a04961b0dd
convert/svn: remove useless encoding/decoding calls (issue1676)
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
11 cd project-orig |
48a04961b0dd
convert/svn: remove useless encoding/decoding calls (issue1676)
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
12 mkdir trunk |
48a04961b0dd
convert/svn: remove useless encoding/decoding calls (issue1676)
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
13 mkdir branches |
48a04961b0dd
convert/svn: remove useless encoding/decoding calls (issue1676)
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
14 mkdir tags |
48a04961b0dd
convert/svn: remove useless encoding/decoding calls (issue1676)
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
15 cd .. |
48a04961b0dd
convert/svn: remove useless encoding/decoding calls (issue1676)
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
16 |
48a04961b0dd
convert/svn: remove useless encoding/decoding calls (issue1676)
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
17 svnadmin create svn-repo |
48a04961b0dd
convert/svn: remove useless encoding/decoding calls (issue1676)
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
18 svnurl=file://`pwd`/svn-repo |
48a04961b0dd
convert/svn: remove useless encoding/decoding calls (issue1676)
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
19 svn import project-orig $svnurl -m "init projA" |
48a04961b0dd
convert/svn: remove useless encoding/decoding calls (issue1676)
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
20 |
48a04961b0dd
convert/svn: remove useless encoding/decoding calls (issue1676)
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
21 svn co $svnurl project |
48a04961b0dd
convert/svn: remove useless encoding/decoding calls (issue1676)
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
22 cd project |
48a04961b0dd
convert/svn: remove useless encoding/decoding calls (issue1676)
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
23 echo e > trunk/é |
48a04961b0dd
convert/svn: remove useless encoding/decoding calls (issue1676)
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
24 mkdir trunk/à |
48a04961b0dd
convert/svn: remove useless encoding/decoding calls (issue1676)
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
25 echo d > trunk/à/é |
48a04961b0dd
convert/svn: remove useless encoding/decoding calls (issue1676)
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
26 svn add trunk/é trunk/à |
48a04961b0dd
convert/svn: remove useless encoding/decoding calls (issue1676)
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
27 svn ci -m hello |
48a04961b0dd
convert/svn: remove useless encoding/decoding calls (issue1676)
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
28 |
48a04961b0dd
convert/svn: remove useless encoding/decoding calls (issue1676)
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
29 # Copy files and directories |
48a04961b0dd
convert/svn: remove useless encoding/decoding calls (issue1676)
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
30 svn mv trunk/é trunk/è |
48a04961b0dd
convert/svn: remove useless encoding/decoding calls (issue1676)
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
31 svn mv trunk/à trunk/ù |
48a04961b0dd
convert/svn: remove useless encoding/decoding calls (issue1676)
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
32 svn ci -m "copy files" |
48a04961b0dd
convert/svn: remove useless encoding/decoding calls (issue1676)
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
33 |
48a04961b0dd
convert/svn: remove useless encoding/decoding calls (issue1676)
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
34 # Remove files |
48a04961b0dd
convert/svn: remove useless encoding/decoding calls (issue1676)
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
35 svn rm trunk/è |
48a04961b0dd
convert/svn: remove useless encoding/decoding calls (issue1676)
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
36 svn rm trunk/ù |
48a04961b0dd
convert/svn: remove useless encoding/decoding calls (issue1676)
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
37 svn ci -m 'remove files' |
8886
0593c5b5b1f0
convert/svn: stop returning unicode revision identifiers
Patrick Mezard <pmezard@gmail.com>
parents:
8882
diff
changeset
|
38 |
0593c5b5b1f0
convert/svn: stop returning unicode revision identifiers
Patrick Mezard <pmezard@gmail.com>
parents:
8882
diff
changeset
|
39 # Create branches with and from weird names |
0593c5b5b1f0
convert/svn: stop returning unicode revision identifiers
Patrick Mezard <pmezard@gmail.com>
parents:
8882
diff
changeset
|
40 svn up |
0593c5b5b1f0
convert/svn: stop returning unicode revision identifiers
Patrick Mezard <pmezard@gmail.com>
parents:
8882
diff
changeset
|
41 svn cp trunk branches/branché |
0593c5b5b1f0
convert/svn: stop returning unicode revision identifiers
Patrick Mezard <pmezard@gmail.com>
parents:
8882
diff
changeset
|
42 echo a > branches/branché/a |
0593c5b5b1f0
convert/svn: stop returning unicode revision identifiers
Patrick Mezard <pmezard@gmail.com>
parents:
8882
diff
changeset
|
43 svn ci -m 'branch to branché' |
0593c5b5b1f0
convert/svn: stop returning unicode revision identifiers
Patrick Mezard <pmezard@gmail.com>
parents:
8882
diff
changeset
|
44 svn up |
0593c5b5b1f0
convert/svn: stop returning unicode revision identifiers
Patrick Mezard <pmezard@gmail.com>
parents:
8882
diff
changeset
|
45 svn cp branches/branché branches/branchée |
0593c5b5b1f0
convert/svn: stop returning unicode revision identifiers
Patrick Mezard <pmezard@gmail.com>
parents:
8882
diff
changeset
|
46 echo a >> branches/branché/a |
0593c5b5b1f0
convert/svn: stop returning unicode revision identifiers
Patrick Mezard <pmezard@gmail.com>
parents:
8882
diff
changeset
|
47 svn ci -m 'branch to branchée' |
8887
0332f8b44e54
convert/svn: test svn tags encoding
Patrick Mezard <pmezard@gmail.com>
parents:
8886
diff
changeset
|
48 |
0332f8b44e54
convert/svn: test svn tags encoding
Patrick Mezard <pmezard@gmail.com>
parents:
8886
diff
changeset
|
49 # Create tag with weird name |
0332f8b44e54
convert/svn: test svn tags encoding
Patrick Mezard <pmezard@gmail.com>
parents:
8886
diff
changeset
|
50 svn up |
0332f8b44e54
convert/svn: test svn tags encoding
Patrick Mezard <pmezard@gmail.com>
parents:
8886
diff
changeset
|
51 svn cp trunk tags/branché |
0332f8b44e54
convert/svn: test svn tags encoding
Patrick Mezard <pmezard@gmail.com>
parents:
8886
diff
changeset
|
52 svn ci -m 'tag trunk' |
0332f8b44e54
convert/svn: test svn tags encoding
Patrick Mezard <pmezard@gmail.com>
parents:
8886
diff
changeset
|
53 svn cp branches/branchée tags/branchée |
0332f8b44e54
convert/svn: test svn tags encoding
Patrick Mezard <pmezard@gmail.com>
parents:
8886
diff
changeset
|
54 svn ci -m 'tag branché' |
8882
48a04961b0dd
convert/svn: remove useless encoding/decoding calls (issue1676)
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
55 cd .. |
48a04961b0dd
convert/svn: remove useless encoding/decoding calls (issue1676)
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
56 |
48a04961b0dd
convert/svn: remove useless encoding/decoding calls (issue1676)
Patrick Mezard <pmezard@gmail.com>
parents:
diff
changeset
|
57 svnadmin dump svn-repo > ../encoding.svndump |