Mercurial > hgrepos > DevTools > mercurial-extensions
changeset 412:4fc9b92295b2
Unit test for rebase
| author | Franz Glasner <fzglas.hg@dom66.de> |
|---|---|
| date | Sat, 01 Feb 2020 14:50:44 +0100 |
| parents | 4c2088eea12c |
| children | 0ad9dff8835d |
| files | tests/test-timestamps.t |
| diffstat | 1 files changed, 52 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/tests/test-timestamps.t Sat Feb 01 14:49:51 2020 +0100 +++ b/tests/test-timestamps.t Sat Feb 01 14:50:44 2020 +0100 @@ -664,3 +664,55 @@ 2019/Liederzettel/2019-11-01_Allerheiligen.txt,2019-12-24T11:31:12.940000Z 2019/Liederzettel/2019-11-10_Leonhardsfest_Irlahuell.txt,2019-12-24T11:38:09.060000Z $ cd .. + + +9. Test with "rebase" +===================== + + $ prepare_mini_repo "ts11" + $ cd ts11 + $ echo "c1" >f1 + $ touch -d 2017-12-01T01:02:03Z f1 + $ echo "c2" >f2 + $ touch -d 2017-12-01T02:03:04Z f2 + $ hg add f1 f2 + $ hg ci -m "ADD: f1 f2" + $ cat .hgtimestamps.db + version=1 + encoding=binary + f1,2017-12-01T01:02:03Z + f2,2017-12-01T02:03:04Z + $ echo "c1c1" >>f1 + $ touch -d 2017-12-01T03:04:05Z f1 + $ hg ci -m "CHANGE: f1" + $ cat .hgtimestamps.db + version=1 + encoding=binary + f1,2017-12-01T03:04:05Z + f2,2017-12-01T02:03:04Z + $ hg update -r-2 + 2 files updated, 0 files merged, 0 files removed, 0 files unresolved + $ echo "c1c1-new-head" >>f1 + $ hg ci -m "CHANGE: f1 with new head" + created new head + $ hg rebase -s3 -d2 + rebasing 3:[0-9a-f]+ "CHANGE: f1 with new head" \(tip\) (re) + timestamps: no recorded hook data + merging .hgtimestamps.db + merging f1 + warning: conflicts while merging .hgtimestamps.db! (edit, then use 'hg resolve --mark') + warning: conflicts while merging f1! (edit, then use 'hg resolve --mark') + timestamps: no recorded hook data + unresolved conflicts (see hg resolve, then hg rebase --continue) + [1] + +Just test whether a hypothetical resolve would work + + $ hg -q resolve -m .hgtimestamps.db + $ hg -q resolve -m f1 + continue: hg rebase --continue + $ hg rebase --continue + rebasing 3:[0-9a-f]+ "CHANGE: f1 with new head" \(tip\) (re) + timestamps: no `match' instance given in commit - deactivating timestamps in this commit + saved backup bundle to \$TESTTMP/ts11/\.hg/strip-backup/[0-9a-f-]+-rebase\.hg (re) + $ cd ..
