Mercurial > hgrepos > DevTools > mercurial-extensions
changeset 279:fd0f5631d11a
Test also the already implemented abort of a merge
| author | Franz Glasner <hg@dom66.de> |
|---|---|
| date | Sat, 05 Jan 2019 17:04:50 +0100 |
| parents | 7ec353866f70 |
| children | a9d08cf9a44f |
| files | tests/test-timestamps.t |
| diffstat | 1 files changed, 69 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/tests/test-timestamps.t Sat Jan 05 12:12:42 2019 +0100 +++ b/tests/test-timestamps.t Sat Jan 05 17:04:50 2019 +0100 @@ -156,8 +156,8 @@ $ cd .. -3. Test a failing merge -======================= +3. Test a merge with conflicts +============================== $ prepare_repo "ts3" $ cd ts3 @@ -182,4 +182,71 @@ files/test2.txt,2017-12-01T07:08:09Z files/test4-2.txt,2017-12-01T06:07:08Z >>>>>>> merge rev: * (glob) + $ ls -1 files + test1.txt + test2.txt + test2.txt.orig (?) + test3.txt + test4-2.txt + +Unchanged files should have there old timestamps, new files in `other' +should have their respective stored old timestamp. Only +changed/conflicting files should have a new modtime. + + $ "$TSPY" "$TESTDIR/lib-stat.py" --check=2017-12-01T02:03:04Z files/test1.txt + $ "$TSPY" "$TESTDIR/lib-stat.py" --differs=2017-12-01T08:09:10Z files/test2.txt + $ "$TSPY" "$TESTDIR/lib-stat.py" --check=2017-12-01T05:06:07Z files/test3.txt + +Abort the merge for now + + $ hg merge --quiet --abort + $ hg status -mard + $ "$TSPY" "$TESTDIR/lib-stat.py" --check=2017-12-01T02:03:04Z files/test1.txt + $ "$TSPY" "$TESTDIR/lib-stat.py" --check=2017-12-01T08:09:10Z files/test2.txt + $ "$TSPY" "$TESTDIR/lib-stat.py" --check=2017-12-01T05:06:07Z files/test3.txt + $ ls -1 files + test1.txt + test2.txt + test2.txt.orig (?) + test3.txt + + +Redo the very same merge again -- should have the very same outcome + + $ hg merge -r7 --tool=:merge3 + merging .hgtimestamps.db + merging files/test2.txt + warning: conflicts while merging .hgtimestamps.db! (edit, then use 'hg resolve --mark') + warning: conflicts while merging files/test2.txt! (edit, then use 'hg resolve --mark') + 1 files updated, 0 files merged, 0 files removed, 2 files unresolved + use 'hg resolve' to retry unresolved file merges or 'hg merge --abort' to abandon + [1] + $ cat .hgtimestamps.db + version=1 + encoding=binary + files/test1.txt,2017-12-01T02:03:04Z + <<<<<<< working copy: * (glob) + files/test2.txt,2017-12-01T08:09:10Z + files/test3.txt,2017-12-01T05:06:07Z + ||||||| base + files/test2.txt,2017-12-01T04:05:06Z + ======= + files/test2.txt,2017-12-01T07:08:09Z + files/test4-2.txt,2017-12-01T06:07:08Z + >>>>>>> merge rev: * (glob) + $ ls -1 files + test1.txt + test2.txt + test2.txt.orig (?) + test3.txt + test4-2.txt + +Again: unchanged files should have there old timestamps, new files in +`other' should have their respective stored old timestamp. Only +changed/conflicting files should have a new modtime. + + $ "$TSPY" "$TESTDIR/lib-stat.py" --check=2017-12-01T02:03:04Z files/test1.txt + $ "$TSPY" "$TESTDIR/lib-stat.py" --differs=2017-12-01T08:09:10Z files/test2.txt + $ "$TSPY" "$TESTDIR/lib-stat.py" --check=2017-12-01T05:06:07Z files/test3.txt + $ cd ..
