sapling/eden/scm/tests/test-bookmarks-rebase.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

107 lines
2.4 KiB
Perl

#require py2
#chg-compatible
TODO: configure mutation
$ configure noevolution
$ enable rebase
initialize repository
$ hg init
$ echo 'a' > a
$ hg ci -A -m "0"
adding a
$ echo 'b' > b
$ hg ci -A -m "1"
adding b
$ hg up 0
0 files updated, 0 files merged, 1 files removed, 0 files unresolved
$ echo 'c' > c
$ hg ci -A -m "2"
adding c
$ echo 'd' > d
$ hg ci -A -m "3"
adding d
$ hg bookmark -r 1 one
$ hg bookmark -r 3 two
$ hg up -q two
bookmark list
$ hg bookmark
one 1:925d80f479bb
* two 3:2ae46b1d99a7
rebase
$ hg rebase -s two -d one
rebasing 2ae46b1d99a7 "3" (two)
saved backup bundle to $TESTTMP/.hg/strip-backup/2ae46b1d99a7-e6b057bc-rebase.hg
$ hg log
changeset: 3:42e5ed2cdcf4
bookmark: two
parent: 1:925d80f479bb
user: test
date: Thu Jan 01 00:00:00 1970 +0000
summary: 3
changeset: 2:db815d6d32e6
parent: 0:f7b1eb17ad24
user: test
date: Thu Jan 01 00:00:00 1970 +0000
summary: 2
changeset: 1:925d80f479bb
bookmark: one
user: test
date: Thu Jan 01 00:00:00 1970 +0000
summary: 1
changeset: 0:f7b1eb17ad24
user: test
date: Thu Jan 01 00:00:00 1970 +0000
summary: 0
aborted rebase should restore active bookmark.
$ hg up 1
0 files updated, 0 files merged, 1 files removed, 0 files unresolved
(leaving bookmark two)
$ echo 'e' > d
$ hg ci -A -m "4"
adding d
$ hg bookmark three
$ hg rebase -s three -d two
rebasing dd7c838e8362 "4" (three)
merging d
warning: 1 conflicts while merging d! (edit, then use 'hg resolve --mark')
unresolved conflicts (see hg resolve, then hg rebase --continue)
[1]
$ hg rebase --abort
rebase aborted
$ hg bookmark
one 1:925d80f479bb
* three 4:dd7c838e8362
two 3:42e5ed2cdcf4
after aborted rebase, restoring a bookmark that has been removed should not fail
$ hg rebase -s three -d two
rebasing dd7c838e8362 "4" (three)
merging d
warning: 1 conflicts while merging d! (edit, then use 'hg resolve --mark')
unresolved conflicts (see hg resolve, then hg rebase --continue)
[1]
$ hg bookmark -d three
$ hg rebase --abort
rebase aborted
$ hg bookmark
one 1:925d80f479bb
two 3:42e5ed2cdcf4