sapling/eden/scm/tests/test-rebase-inmemory-conflicts.t
Zeyi (Rice) Fan 92f6f35e7a mark all tests requiring Python 2
Summary:
This diff marks **ALL** mercurial tests requiring Python 2 feature.

After you fixes some tests, simply remove the `py2` feature requirement and that tests will be continuously run after your diff is landed.

To bypass this feature requirement, run the tests command with `HGTEST_FORCE_PY2=1`. For example:

```
HGTEST_FORCE_PY2=1 buck test //eden/scm/tests:hg_run_tests
```

or

```
HGTEST_FORCE_PY2=1 python run-tests.py
```

----

Basically this diff are created with the following commands:

```
$ sed -i 's/import feature\(.*\)$/import feature\1\n\nfeature.require(["py2"])/' test-*-t.py
$ sed -i '1s/^/#require py2\n/' test-*.t
$ ls | grep -P "^test.*(?<\!-t)\.py$" > list && vim -p $(cat list)
# manually adding feature requires for these Python tests.
```

(Note: this ignores all push blocking failures!)

ignore-conflict-markers

Reviewed By: singhsrb

Differential Revision: D19655148

fbshipit-source-id: 985e3ccb4010cc559049f1d89f8909bc2d9b5e20
2020-01-30 18:49:21 -08:00

105 lines
2.2 KiB
Perl

#require py2
#chg-compatible
Test new conflict switching:
$ configure mutation-norecord
$ newrepo
$ enable amend morestatus rebase
$ setconfig morestatus.show=True
$ setconfig rebase.singletransaction=True
$ setconfig rebase.experimental.inmemory=True
$ setconfig rebase.experimental.inmemorywarning="rebasing in-memory!"
$ hg debugdrawdag <<'EOS'
> f
> |
> e
> |
> c d
> |/
> b g
> |/
> a
> EOS
Make conflicts halfway up the stack:
$ hg up -C f
5 files updated, 0 files merged, 0 files removed, 0 files unresolved
(activating bookmark f)
$ echo "conflict" > c
$ hg add c
$ hg amend -q
$ hg rebase -q -s g -d .
rebasing in-memory!
$ hg log -G -r 0:: -T '{desc}'
o g
|
@ f
|
o e
|
o d
|
| o c
|/
o b
|
o a
$ cp -R . ../control
$ hg rebase -d c
rebasing in-memory!
rebasing f4016ed9f5d0 "d" (d)
rebasing 881eb15e0fdf "e" (e)
rebasing e692c3b32196 "f" (f)
merging c
hit merge conflicts (in c); switching to on-disk merge
rebasing e692c3b32196 "f" (f)
merging c
warning: 1 conflicts while merging c! (edit, then use 'hg resolve --mark')
unresolved conflicts (see hg resolve, then hg rebase --continue)
[1]
$ hg resolve --all --tool :other
(no more unresolved files)
continue: hg rebase --continue
$ hg rebase --continue
already rebased f4016ed9f5d0 "d" (d) as 32bb4413a7df
already rebased 881eb15e0fdf "e" (e) as d82c41319fdd
rebasing e692c3b32196 "f" (f)
rebasing 2a19607ff85c "g" (g)
$ hg log -G -r 0:: -T '{desc} {rev} {node|short}'
o g 12 24c12a3229e2
|
@ f 11 c33e7f678afd
|
o e 10 d82c41319fdd
|
o d 9 32bb4413a7df
|
o c 3 a82ac2b38757
|
o b 1 488e1b7e7341
|
o a 0 b173517d0057
Try it with uncommitted changes, ensure it aborts nicely:
$ hg up -Cq a
$ hg clean
$ echo "test" > a
$ hg rebase -s d82c41319fdd -d a
rebasing in-memory!
rebasing d82c41319fdd "e" (e)
rebasing c33e7f678afd "f" (f)
transaction abort!
rollback completed
abort: must use on-disk merge for this rebase (hit merge conflicts in c), but you have working copy changes
(commit, revert, or shelve them)
[255]
$ hg st
M a
$ cat a
test