Mercurial > hg
annotate tests/test-merge-combination-misc.t @ 46415:8deab876fb59 stable
wix: tell ComponentSearch that it is finding a directory (not a file)
This is to fix an issue we've noticed where fresh installations start at
`C:\Program Files\Mercurial`, and then upgrades "walk up" the tree and end up in
`C:\Program Files` and finally `C:\` (where they stay).
ComponentSearch defaults to finding files, which I think means "it produces a
string like `C:\Program Files\Mercurial`", whereas with the type being
explicitly a directory, it would return `C:\Program Files\Mercurial\` (note the
final trailing backslash). Presumably, a latter step then tries to turn that
file name into a proper directory, by removing everything after the last `\`.
This could likely also be fixed by actually searching for the component for
hg.exe itself. That seemed a lot more complicated, as the GUID for hg.exe isn't
known in this file (it's one of the "auto-derived" ones). We could also consider
adding a Condition that I think could check the Property and ensure it's either
empty or ends in a trailing slash, but that would be an installer runtime check
and I'm not convinced it'd actually be useful.
This will *not* cause existing installations that are in one of the bad
directories to fix themselves. Doing that would require a fair amount more
understanding of wix and windows installer than I have, and it *probably*
wouldn't be possible to be 100% correct about it either (there's nothing
preventing a user from intentionally installing it in C:\, though I don't know
why they would do so).
If someone wants to tackle fixing existing installations, I think that the first
installation is actually the only one that shows up in "Add or Remove Programs",
and that its registry keys still exist. You might be able to find something
under HKEY_USERS that lists both the "good" and the "bad" InstallDirs. Mine was
under `HKEY_USERS\S-1-5-18\Software\Mercurial\InstallDir` (C:\), and
`HKEY_USERS\S-1-5-21-..numbers..\Software\Mercurial\InstallDir` (C:\Program
Files\Mercurial). If you find exactly two, with one being the default path, and
the other being a prefix of it, the user almost certainly hit this bug :D
We had originally thought that this bug might be due to unattended
installations/upgrades, but I no longer think that's the case. We were able to
reproduce the issue by uninstalling all copies of Mercurial I could find,
installing one version (it chose the correct location), and then starting the
installer for a different version (higher or lower didn't matter). I did not
need to deal with an unattended or headless installation/upgrade to trigger the
issue, but it's possible that my system was "primed" for this bug to happen
because of a previous unattended installation/upgrade.
Differential Revision: https://phab.mercurial-scm.org/D9891
author | Kyle Lippincott <spectral@google.com> |
---|---|
date | Wed, 27 Jan 2021 10:29:21 -0800 |
parents | e8b0c519dfb3 |
children |
rev | line source |
---|---|
46266
e8b0c519dfb3
test: split tests/test-merge-combination.t into multiple parts
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
46265
diff
changeset
|
1 Testing recorded "modified" files for merge commit |
e8b0c519dfb3
test: split tests/test-merge-combination.t into multiple parts
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
46265
diff
changeset
|
2 ================================================== |
e8b0c519dfb3
test: split tests/test-merge-combination.t into multiple parts
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
46265
diff
changeset
|
3 |
42619
20d0e59be79b
tests: show the files fields of changelogs for many merges
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents:
diff
changeset
|
4 This file shows what hg says are "modified" files for a merge commit |
20d0e59be79b
tests: show the files fields of changelogs for many merges
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents:
diff
changeset
|
5 (hg log -T {files}), somewhat exhaustively. |
46266
e8b0c519dfb3
test: split tests/test-merge-combination.t into multiple parts
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
46265
diff
changeset
|
6 |
e8b0c519dfb3
test: split tests/test-merge-combination.t into multiple parts
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
46265
diff
changeset
|
7 This file test multiple corner case. |
e8b0c519dfb3
test: split tests/test-merge-combination.t into multiple parts
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
46265
diff
changeset
|
8 |
e8b0c519dfb3
test: split tests/test-merge-combination.t into multiple parts
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
46265
diff
changeset
|
9 For merges that involve files contents changing, check test-merge-combination-file-content.t |
e8b0c519dfb3
test: split tests/test-merge-combination.t into multiple parts
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
46265
diff
changeset
|
10 |
e8b0c519dfb3
test: split tests/test-merge-combination.t into multiple parts
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
46265
diff
changeset
|
11 For merges that involve executable bit changing, check test-merge-combination-exec-bytes.t |
e8b0c519dfb3
test: split tests/test-merge-combination.t into multiple parts
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
46265
diff
changeset
|
12 |
e8b0c519dfb3
test: split tests/test-merge-combination.t into multiple parts
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
46265
diff
changeset
|
13 |
e8b0c519dfb3
test: split tests/test-merge-combination.t into multiple parts
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
46265
diff
changeset
|
14 Case with multiple or zero merge ancestors, copies/renames, and identical file contents |
e8b0c519dfb3
test: split tests/test-merge-combination.t into multiple parts
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
46265
diff
changeset
|
15 with different filelog revisions are not currently covered. |
42619
20d0e59be79b
tests: show the files fields of changelogs for many merges
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents:
diff
changeset
|
16 |
46265
8045e4aa366b
test: extract the `genmerges` out of test-merge-combination.t
Pierre-Yves David <pierre-yves.david@octobus.net>
parents:
42739
diff
changeset
|
17 $ . $TESTDIR/testlib/merge-combination-util.sh |
42619
20d0e59be79b
tests: show the files fields of changelogs for many merges
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents:
diff
changeset
|
18 |
20d0e59be79b
tests: show the files fields of changelogs for many merges
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents:
diff
changeset
|
19 Files modified or cleanly merged, with no greatest common ancestors: |
20d0e59be79b
tests: show the files fields of changelogs for many merges
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents:
diff
changeset
|
20 |
20d0e59be79b
tests: show the files fields of changelogs for many merges
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents:
diff
changeset
|
21 $ hg init repo; cd repo |
20d0e59be79b
tests: show the files fields of changelogs for many merges
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents:
diff
changeset
|
22 $ touch a0 b0; hg commit -qAm 0 |
20d0e59be79b
tests: show the files fields of changelogs for many merges
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents:
diff
changeset
|
23 $ hg up -qr null; touch a1 b1; hg commit -qAm 1 |
20d0e59be79b
tests: show the files fields of changelogs for many merges
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents:
diff
changeset
|
24 $ hg merge -qr 0; rm b*; hg commit -qAm 2 |
20d0e59be79b
tests: show the files fields of changelogs for many merges
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents:
diff
changeset
|
25 $ hg log -r . -T '{files}\n' |
20d0e59be79b
tests: show the files fields of changelogs for many merges
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents:
diff
changeset
|
26 b0 b1 |
20d0e59be79b
tests: show the files fields of changelogs for many merges
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents:
diff
changeset
|
27 $ cd ../ |
20d0e59be79b
tests: show the files fields of changelogs for many merges
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents:
diff
changeset
|
28 $ rm -rf repo |
20d0e59be79b
tests: show the files fields of changelogs for many merges
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents:
diff
changeset
|
29 |
20d0e59be79b
tests: show the files fields of changelogs for many merges
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents:
diff
changeset
|
30 A few cases of criss-cross merges involving deletions (listing all |
20d0e59be79b
tests: show the files fields of changelogs for many merges
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents:
diff
changeset
|
31 such merges is probably too much). Both gcas contain $files, so we |
20d0e59be79b
tests: show the files fields of changelogs for many merges
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents:
diff
changeset
|
32 expect the final merge to behave like a merge with a single gca |
20d0e59be79b
tests: show the files fields of changelogs for many merges
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents:
diff
changeset
|
33 containing $files. |
20d0e59be79b
tests: show the files fields of changelogs for many merges
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents:
diff
changeset
|
34 |
20d0e59be79b
tests: show the files fields of changelogs for many merges
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents:
diff
changeset
|
35 $ hg init repo; cd repo |
20d0e59be79b
tests: show the files fields of changelogs for many merges
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents:
diff
changeset
|
36 $ files="c1 u1 c2 u2" |
20d0e59be79b
tests: show the files fields of changelogs for many merges
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents:
diff
changeset
|
37 $ touch $files; hg commit -qAm '0 root' |
20d0e59be79b
tests: show the files fields of changelogs for many merges
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents:
diff
changeset
|
38 $ for f in $files; do echo f > $f; done; hg commit -qAm '1 gca1' |
20d0e59be79b
tests: show the files fields of changelogs for many merges
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents:
diff
changeset
|
39 $ hg up -qr0; hg revert -qr 1 --all; hg commit -qAm '2 gca2' |
20d0e59be79b
tests: show the files fields of changelogs for many merges
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents:
diff
changeset
|
40 $ hg up -qr 1; hg merge -qr 2; rm *1; hg commit -qAm '3 p1' |
20d0e59be79b
tests: show the files fields of changelogs for many merges
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents:
diff
changeset
|
41 $ hg up -qr 2; hg merge -qr 1; rm *2; hg commit -qAm '4 p2' |
20d0e59be79b
tests: show the files fields of changelogs for many merges
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents:
diff
changeset
|
42 $ hg merge -qr 3; echo f > u1; echo f > u2; rm -f c1 c2 |
20d0e59be79b
tests: show the files fields of changelogs for many merges
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents:
diff
changeset
|
43 $ hg commit -qAm '5 merge with two gcas' |
20d0e59be79b
tests: show the files fields of changelogs for many merges
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents:
diff
changeset
|
44 $ hg log -r . -T '{files}\n' # expecting u1 u2 |
42621
99ebde4fec99
commit: improve the files field of changelog for merges
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents:
42619
diff
changeset
|
45 |
42619
20d0e59be79b
tests: show the files fields of changelogs for many merges
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents:
diff
changeset
|
46 $ cd ../ |
20d0e59be79b
tests: show the files fields of changelogs for many merges
Valentin Gatien-Baron <valentin.gatienbaron@gmail.com>
parents:
diff
changeset
|
47 $ rm -rf repo |