Mercurial > hg
annotate tests/test-pull-update.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 | 76df01e56e7f |
children | 216cc65cf227 |
rev | line source |
---|---|
12279 | 1 $ hg init t |
2 $ cd t | |
3 $ echo 1 > foo | |
4 $ hg ci -Am m | |
5 adding foo | |
6 | |
7 $ cd .. | |
8 $ hg clone t tt | |
9 updating to branch default | |
10 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
11 $ cd tt | |
12 $ echo 1.1 > foo | |
13 $ hg ci -Am m | |
5080
73fdc8bd3ed8
Update on pull -u when heads were closed (fixes issue666).
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff
changeset
|
14 |
12279 | 15 $ cd ../t |
16 $ echo 1.2 > foo | |
17 $ hg ci -Am m | |
18 | |
19 Should not update: | |
5080
73fdc8bd3ed8
Update on pull -u when heads were closed (fixes issue666).
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff
changeset
|
20 |
12279 | 21 $ hg pull -u ../tt |
22 pulling from ../tt | |
23 searching for changes | |
24 adding changesets | |
25 adding manifests | |
26 adding file changes | |
27 added 1 changesets with 1 changes to 1 files (+1 heads) | |
19798
76df01e56e7f
update: improve error message for clean non-linear update
Siddharth Agarwal <sid0@fb.com>
parents:
16913
diff
changeset
|
28 not updating: not a linear update |
76df01e56e7f
update: improve error message for clean non-linear update
Siddharth Agarwal <sid0@fb.com>
parents:
16913
diff
changeset
|
29 (merge or update --check to force update) |
12279 | 30 |
31 $ cd ../tt | |
5080
73fdc8bd3ed8
Update on pull -u when heads were closed (fixes issue666).
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff
changeset
|
32 |
12279 | 33 Should not update: |
34 | |
35 $ hg pull -u ../t | |
36 pulling from ../t | |
37 searching for changes | |
38 adding changesets | |
39 adding manifests | |
40 adding file changes | |
41 added 1 changesets with 1 changes to 1 files (+1 heads) | |
19798
76df01e56e7f
update: improve error message for clean non-linear update
Siddharth Agarwal <sid0@fb.com>
parents:
16913
diff
changeset
|
42 not updating: not a linear update |
76df01e56e7f
update: improve error message for clean non-linear update
Siddharth Agarwal <sid0@fb.com>
parents:
16913
diff
changeset
|
43 (merge or update --check to force update) |
5080
73fdc8bd3ed8
Update on pull -u when heads were closed (fixes issue666).
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff
changeset
|
44 |
12279 | 45 $ HGMERGE=true hg merge |
46 merging foo | |
47 0 files updated, 1 files merged, 0 files removed, 0 files unresolved | |
48 (branch merge, don't forget to commit) | |
49 $ hg ci -mm | |
50 | |
51 $ cd ../t | |
52 | |
53 Should work: | |
5080
73fdc8bd3ed8
Update on pull -u when heads were closed (fixes issue666).
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff
changeset
|
54 |
12279 | 55 $ hg pull -u ../tt |
56 pulling from ../tt | |
57 searching for changes | |
58 adding changesets | |
59 adding manifests | |
60 adding file changes | |
61 added 1 changesets with 1 changes to 1 files (-1 heads) | |
62 1 files updated, 0 files merged, 0 files removed, 0 files unresolved | |
63 | |
16913
f2719b387380
tests: add missing trailing 'cd ..'
Mads Kiilerich <mads@kiilerich.com>
parents:
14485
diff
changeset
|
64 $ cd .. |