tests/test-merge-local
author Alexis S. L. Carvalho <alexis@cecm.usp.br>
Thu, 04 Oct 2007 23:21:37 -0300
changeset 5378 8a2915f57dfc
parent 4361 46280c004f22
permissions -rwxr-xr-x
convert: add a mode where mercurial_sink skips empty revisions. The getchanges function of some converter_source classes can return some false positives. I.e. they sometimes claim that a file "foo" was changed in some revision, even though its contents are still the same. convert_svn is particularly bad, but I think this can also happen with convert_cvs and, at least in theory, with mercurial_source. For regular conversions this is not really a problem - as long as getfile returns the right contents, we'll get a converted revision with the right contents. But when we use --filemap, this could lead to superfluous revisions being converted. Instead of fixing every converter_source, I decided to change mercurial_sink to work around this problem. When --filemap is used, we're interested only in revisions that touch some specific files. If a revision doesn't change any of these files, then we're not interested in it (at least for revisions with a single parent; merges are special). For mercurial_sink, we abuse this property and rollback a commit if the manifest text hasn't changed. This avoids duplicating the logic from localrepo.filecommit to detect unchanged files.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
3869
ad6f34c83c3d Add instructions how to redo/finish failed merge with local working directory.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
     1
#!/bin/sh
ad6f34c83c3d Add instructions how to redo/finish failed merge with local working directory.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
     2
ad6f34c83c3d Add instructions how to redo/finish failed merge with local working directory.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
     3
hg init
ad6f34c83c3d Add instructions how to redo/finish failed merge with local working directory.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
     4
ad6f34c83c3d Add instructions how to redo/finish failed merge with local working directory.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
     5
echo "# revision 0"
ad6f34c83c3d Add instructions how to redo/finish failed merge with local working directory.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
     6
echo "unchanged" > unchanged
ad6f34c83c3d Add instructions how to redo/finish failed merge with local working directory.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
     7
echo "remove me" > remove
ad6f34c83c3d Add instructions how to redo/finish failed merge with local working directory.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
     8
echo "copy me" > copy
ad6f34c83c3d Add instructions how to redo/finish failed merge with local working directory.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
     9
echo "move me" > move
ad6f34c83c3d Add instructions how to redo/finish failed merge with local working directory.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
    10
for i in 1 2 3 4 5 6 7 8 9; do
ad6f34c83c3d Add instructions how to redo/finish failed merge with local working directory.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
    11
    echo "merge ok $i" >> zzz1_merge_ok
ad6f34c83c3d Add instructions how to redo/finish failed merge with local working directory.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
    12
done
ad6f34c83c3d Add instructions how to redo/finish failed merge with local working directory.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
    13
echo "merge bad" > zzz2_merge_bad
ad6f34c83c3d Add instructions how to redo/finish failed merge with local working directory.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
    14
hg ci -Am "revision 0" -d "1000000 0"
ad6f34c83c3d Add instructions how to redo/finish failed merge with local working directory.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
    15
ad6f34c83c3d Add instructions how to redo/finish failed merge with local working directory.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
    16
echo "# revision 1"
ad6f34c83c3d Add instructions how to redo/finish failed merge with local working directory.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
    17
hg rm remove
ad6f34c83c3d Add instructions how to redo/finish failed merge with local working directory.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
    18
hg mv move moved
ad6f34c83c3d Add instructions how to redo/finish failed merge with local working directory.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
    19
hg cp copy copied
ad6f34c83c3d Add instructions how to redo/finish failed merge with local working directory.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
    20
echo "added" > added
ad6f34c83c3d Add instructions how to redo/finish failed merge with local working directory.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
    21
hg add added
ad6f34c83c3d Add instructions how to redo/finish failed merge with local working directory.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
    22
echo "new first line" > zzz1_merge_ok
ad6f34c83c3d Add instructions how to redo/finish failed merge with local working directory.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
    23
hg cat zzz1_merge_ok >> zzz1_merge_ok
ad6f34c83c3d Add instructions how to redo/finish failed merge with local working directory.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
    24
echo "new last line" >> zzz2_merge_bad
ad6f34c83c3d Add instructions how to redo/finish failed merge with local working directory.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
    25
hg ci -m "revision 1" -d "1000000 0"
ad6f34c83c3d Add instructions how to redo/finish failed merge with local working directory.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
    26
ad6f34c83c3d Add instructions how to redo/finish failed merge with local working directory.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
    27
echo "# local changes to revision 0"
ad6f34c83c3d Add instructions how to redo/finish failed merge with local working directory.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
    28
hg co 0
ad6f34c83c3d Add instructions how to redo/finish failed merge with local working directory.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
    29
echo "new last line" >> zzz1_merge_ok
ad6f34c83c3d Add instructions how to redo/finish failed merge with local working directory.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
    30
echo "another last line" >> zzz2_merge_bad
ad6f34c83c3d Add instructions how to redo/finish failed merge with local working directory.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
    31
hg diff --nodates | grep "^[+-][^<>]"
ad6f34c83c3d Add instructions how to redo/finish failed merge with local working directory.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
    32
hg st
ad6f34c83c3d Add instructions how to redo/finish failed merge with local working directory.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
    33
ad6f34c83c3d Add instructions how to redo/finish failed merge with local working directory.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
    34
echo "# local merge with bad merge tool"
ad6f34c83c3d Add instructions how to redo/finish failed merge with local working directory.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
    35
HGMERGE=false hg co
ad6f34c83c3d Add instructions how to redo/finish failed merge with local working directory.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
    36
hg co 0
ad6f34c83c3d Add instructions how to redo/finish failed merge with local working directory.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
    37
hg diff --nodates | grep "^[+-][^<>]"
ad6f34c83c3d Add instructions how to redo/finish failed merge with local working directory.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
    38
hg st
ad6f34c83c3d Add instructions how to redo/finish failed merge with local working directory.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
    39
ad6f34c83c3d Add instructions how to redo/finish failed merge with local working directory.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
    40
echo "# local merge with conflicts"
4361
46280c004f22 change tests to use simplemerge by default
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3869
diff changeset
    41
hg co
3869
ad6f34c83c3d Add instructions how to redo/finish failed merge with local working directory.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
    42
hg co 0
ad6f34c83c3d Add instructions how to redo/finish failed merge with local working directory.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
    43
hg diff --nodates | grep "^[+-][^<>]"
ad6f34c83c3d Add instructions how to redo/finish failed merge with local working directory.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
    44
hg st
ad6f34c83c3d Add instructions how to redo/finish failed merge with local working directory.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
    45
ad6f34c83c3d Add instructions how to redo/finish failed merge with local working directory.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
    46
echo "# local merge without conflicts"
ad6f34c83c3d Add instructions how to redo/finish failed merge with local working directory.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
    47
hg revert zzz2_merge_bad
4361
46280c004f22 change tests to use simplemerge by default
Alexis S. L. Carvalho <alexis@cecm.usp.br>
parents: 3869
diff changeset
    48
hg co
3869
ad6f34c83c3d Add instructions how to redo/finish failed merge with local working directory.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
    49
hg diff --nodates | grep "^[+-][^<>]"
ad6f34c83c3d Add instructions how to redo/finish failed merge with local working directory.
Thomas Arendsen Hein <thomas@intevation.de>
parents:
diff changeset
    50
hg st