2019-12-10 02:24:31 +03:00
|
|
|
#chg-compatible
|
|
|
|
|
2020-06-11 03:33:43 +03:00
|
|
|
$ configure mutation-norecord
|
2020-01-20 13:42:49 +03:00
|
|
|
$ enable morestatus fbhistedit histedit rebase reset
|
|
|
|
$ setconfig morestatus.show=true
|
2015-11-27 16:16:53 +03:00
|
|
|
$ cat >> $TESTTMP/breakupdate.py << EOF
|
|
|
|
> import sys
|
2019-01-30 03:25:33 +03:00
|
|
|
> from edenscm.mercurial import merge
|
2015-11-27 16:16:53 +03:00
|
|
|
> def extsetup(ui):
|
|
|
|
> merge.applyupdates = lambda *args, **kwargs: sys.exit()
|
|
|
|
> EOF
|
2017-12-01 22:47:31 +03:00
|
|
|
$ breakupdate() {
|
2020-01-20 13:42:49 +03:00
|
|
|
> setconfig extensions.breakupdate="$TESTTMP/breakupdate.py"
|
2017-12-01 22:47:31 +03:00
|
|
|
> }
|
|
|
|
$ unbreakupdate() {
|
2020-01-20 13:42:49 +03:00
|
|
|
> disable breakupdate
|
2017-12-01 22:47:31 +03:00
|
|
|
> }
|
2015-10-02 06:17:28 +03:00
|
|
|
|
|
|
|
Test An empty repo should return no extra output
|
|
|
|
$ hg init repo
|
|
|
|
$ cd repo
|
|
|
|
$ hg status
|
|
|
|
|
|
|
|
Test status on histedit stop
|
|
|
|
$ echo 'a' > a
|
|
|
|
$ hg commit -Am 'a' -q
|
|
|
|
$ hg histedit -q --commands - . 2> /dev/null << EOF
|
|
|
|
> stop cb9a9f314b8b a
|
|
|
|
> EOF
|
|
|
|
[1]
|
|
|
|
$ hg status
|
|
|
|
|
|
|
|
# The repository is in an unfinished *histedit* state.
|
2015-10-08 03:03:17 +03:00
|
|
|
# To continue: hg histedit --continue
|
|
|
|
# To abort: hg histedit --abort
|
2015-10-02 06:17:28 +03:00
|
|
|
|
|
|
|
Test disabling output. Nothing should be shown
|
|
|
|
$ hg status --config morestatus.show=False
|
|
|
|
$ HGPLAIN=1 hg status
|
|
|
|
$ hg histedit -q --continue
|
|
|
|
|
|
|
|
Test no output on normal state
|
|
|
|
$ hg status
|
|
|
|
|
|
|
|
Test bisect state
|
|
|
|
$ hg bisect --good
|
|
|
|
$ hg status
|
|
|
|
|
|
|
|
# The repository is in an unfinished *bisect* state.
|
2020-06-02 18:04:29 +03:00
|
|
|
# Current bisect state: 1 good commit(s), 0 bad commit(s), 0 skip commit(s)
|
2016-09-21 17:45:25 +03:00
|
|
|
# To mark the changeset good: hg bisect --good
|
|
|
|
# To mark the changeset bad: hg bisect --bad
|
2015-10-08 03:40:42 +03:00
|
|
|
# To abort: hg bisect --reset
|
2015-10-02 07:24:43 +03:00
|
|
|
|
2017-05-03 20:34:36 +03:00
|
|
|
Verify that suppressing a morestatus state warning works with the config knob:
|
|
|
|
$ hg status --config morestatus.skipstates=bisect
|
|
|
|
|
2015-10-02 07:24:43 +03:00
|
|
|
Test hg status is normal after bisect reset
|
2015-10-02 06:17:28 +03:00
|
|
|
$ hg bisect --reset
|
2015-10-02 07:24:43 +03:00
|
|
|
$ hg status
|
2015-10-02 06:17:28 +03:00
|
|
|
|
|
|
|
Test graft state
|
2018-10-12 16:22:10 +03:00
|
|
|
$ hg up -q -r 1
|
2015-10-02 06:17:28 +03:00
|
|
|
$ echo '' > a
|
|
|
|
$ hg commit -q -m 'remove content'
|
|
|
|
|
2018-10-12 16:22:10 +03:00
|
|
|
$ hg up -q -r 1
|
2015-10-02 06:17:28 +03:00
|
|
|
$ echo 'ab' > a
|
|
|
|
$ hg commit -q -m 'add content'
|
|
|
|
$ hg graft -q 2977a57
|
2018-10-22 22:45:46 +03:00
|
|
|
warning: 1 conflicts while merging a! (edit, then use 'hg resolve --mark')
|
2015-10-02 06:17:28 +03:00
|
|
|
abort: unresolved conflicts, can't continue
|
2016-04-20 01:33:58 +03:00
|
|
|
(use 'hg resolve' and 'hg graft --continue')
|
2015-10-02 06:17:28 +03:00
|
|
|
[255]
|
|
|
|
$ hg status
|
|
|
|
M a
|
|
|
|
? a.orig
|
|
|
|
|
|
|
|
# The repository is in an unfinished *graft* state.
|
2015-10-02 07:24:43 +03:00
|
|
|
# Unresolved merge conflicts:
|
|
|
|
#
|
|
|
|
# a
|
|
|
|
#
|
|
|
|
# To mark files as resolved: hg resolve --mark FILE
|
2015-10-08 03:03:17 +03:00
|
|
|
# To continue: hg graft --continue
|
2017-01-03 19:25:52 +03:00
|
|
|
# To abort: hg update --clean . (warning: this will discard uncommitted changes)
|
2015-10-02 06:17:28 +03:00
|
|
|
|
2015-10-02 07:24:43 +03:00
|
|
|
Test hg status is normal after graft abort
|
2015-10-02 06:17:28 +03:00
|
|
|
$ hg up --clean -q
|
|
|
|
$ hg status
|
|
|
|
? a.orig
|
|
|
|
$ rm a.orig
|
|
|
|
|
|
|
|
Test unshelve state
|
2020-01-20 13:42:49 +03:00
|
|
|
$ enable shelve
|
2016-01-08 05:30:24 +03:00
|
|
|
$ hg reset ".^" -q
|
2015-10-02 06:17:28 +03:00
|
|
|
$ hg shelve -q
|
|
|
|
$ hg up -r 2977a57 -q
|
|
|
|
$ hg unshelve -q
|
2018-10-22 22:45:46 +03:00
|
|
|
warning: 1 conflicts while merging a! (edit, then use 'hg resolve --mark')
|
2015-10-02 06:17:28 +03:00
|
|
|
unresolved conflicts (see 'hg resolve', then 'hg unshelve --continue')
|
|
|
|
[1]
|
|
|
|
|
|
|
|
$ hg status
|
|
|
|
M a
|
|
|
|
? a.orig
|
|
|
|
|
|
|
|
# The repository is in an unfinished *unshelve* state.
|
2015-10-02 07:24:43 +03:00
|
|
|
# Unresolved merge conflicts:
|
|
|
|
#
|
|
|
|
# a
|
|
|
|
#
|
|
|
|
# To mark files as resolved: hg resolve --mark FILE
|
2015-10-08 03:03:17 +03:00
|
|
|
# To continue: hg unshelve --continue
|
|
|
|
# To abort: hg unshelve --abort
|
2015-10-02 07:24:43 +03:00
|
|
|
|
|
|
|
Test hg status is normal after unshelve abort
|
2015-10-02 06:17:28 +03:00
|
|
|
$ hg unshelve --abort
|
|
|
|
rebase aborted
|
|
|
|
unshelve of 'default' aborted
|
2015-10-02 07:24:43 +03:00
|
|
|
$ hg status
|
|
|
|
? a.orig
|
2015-10-02 06:17:28 +03:00
|
|
|
$ rm a.orig
|
|
|
|
|
|
|
|
Test rebase state
|
|
|
|
$ echo "rebase=" >> $HGRCPATH
|
2018-10-12 16:22:10 +03:00
|
|
|
$ hg up -r 1 -q
|
2015-10-02 06:17:28 +03:00
|
|
|
$ echo 'ab' > a
|
|
|
|
$ hg commit -q -m 'add content'
|
|
|
|
$ hg rebase -s 2977a57 -d . -q
|
2018-10-22 22:45:46 +03:00
|
|
|
warning: 1 conflicts while merging a! (edit, then use 'hg resolve --mark')
|
2015-10-02 06:17:28 +03:00
|
|
|
unresolved conflicts (see hg resolve, then hg rebase --continue)
|
|
|
|
[1]
|
|
|
|
$ hg status
|
|
|
|
M a
|
|
|
|
? a.orig
|
|
|
|
|
|
|
|
# The repository is in an unfinished *rebase* state.
|
2015-10-02 07:24:43 +03:00
|
|
|
# Unresolved merge conflicts:
|
|
|
|
#
|
|
|
|
# a
|
|
|
|
#
|
|
|
|
# To mark files as resolved: hg resolve --mark FILE
|
|
|
|
# To continue: hg rebase --continue
|
|
|
|
# To abort: hg rebase --abort
|
|
|
|
|
|
|
|
Test status in rebase state with resolved files
|
|
|
|
$ hg resolve --mark a
|
|
|
|
(no more unresolved files)
|
2016-01-21 00:40:15 +03:00
|
|
|
continue: hg rebase --continue
|
2015-10-02 07:24:43 +03:00
|
|
|
$ hg status
|
|
|
|
M a
|
|
|
|
? a.orig
|
|
|
|
|
|
|
|
# The repository is in an unfinished *rebase* state.
|
|
|
|
# No unresolved merge conflicts.
|
|
|
|
# To continue: hg rebase --continue
|
|
|
|
# To abort: hg rebase --abort
|
|
|
|
|
|
|
|
Test hg status is normal after rebase abort
|
|
|
|
$ hg rebase --abort -q
|
|
|
|
rebase aborted
|
|
|
|
$ hg status
|
|
|
|
? a.orig
|
|
|
|
$ rm a.orig
|
2015-10-08 03:03:17 +03:00
|
|
|
|
2016-08-11 00:19:30 +03:00
|
|
|
Test rebase with an interrupted update:
|
2017-12-01 22:47:31 +03:00
|
|
|
$ breakupdate
|
|
|
|
$ hg rebase -s 2977a57ce863 -d 79361b8cdbb5 -q
|
|
|
|
$ unbreakupdate
|
2016-08-11 00:19:30 +03:00
|
|
|
$ hg status
|
|
|
|
|
|
|
|
# The repository is in an unfinished *rebase* state.
|
|
|
|
# To continue: hg rebase --continue
|
|
|
|
# To abort: hg rebase --abort
|
|
|
|
$ hg rebase --abort -q
|
|
|
|
rebase aborted
|
|
|
|
|
2015-10-22 01:20:24 +03:00
|
|
|
Test conflicted merge state
|
2015-10-08 03:03:17 +03:00
|
|
|
$ hg merge -q
|
2018-10-22 22:45:46 +03:00
|
|
|
warning: 1 conflicts while merging a! (edit, then use 'hg resolve --mark')
|
2015-10-08 03:03:17 +03:00
|
|
|
[1]
|
|
|
|
$ hg status
|
|
|
|
M a
|
|
|
|
? a.orig
|
|
|
|
|
|
|
|
# The repository is in an unfinished *merge* state.
|
|
|
|
# Unresolved merge conflicts:
|
|
|
|
#
|
|
|
|
# a
|
|
|
|
#
|
|
|
|
# To mark files as resolved: hg resolve --mark FILE
|
|
|
|
# To continue: hg commit
|
2017-01-03 19:25:52 +03:00
|
|
|
# To abort: hg update --clean . (warning: this will discard uncommitted changes)
|
2015-10-08 03:03:17 +03:00
|
|
|
|
2017-05-17 17:13:41 +03:00
|
|
|
Test if listed files have a relative path to current location
|
|
|
|
$ mkdir -p b/c
|
|
|
|
$ cd b/c
|
|
|
|
$ hg status
|
|
|
|
M a
|
|
|
|
? a.orig
|
|
|
|
|
|
|
|
# The repository is in an unfinished *merge* state.
|
|
|
|
# Unresolved merge conflicts:
|
|
|
|
#
|
|
|
|
# ../../a
|
|
|
|
#
|
|
|
|
# To mark files as resolved: hg resolve --mark FILE
|
|
|
|
# To continue: hg commit
|
|
|
|
# To abort: hg update --clean . (warning: this will discard uncommitted changes)
|
|
|
|
$ cd ../..
|
|
|
|
|
2015-10-08 03:03:17 +03:00
|
|
|
Test hg status is normal after merge abort
|
|
|
|
$ hg update --clean -q
|
|
|
|
$ hg status
|
|
|
|
? a.orig
|
|
|
|
$ rm a.orig
|
2015-10-22 01:20:24 +03:00
|
|
|
|
|
|
|
Test non-conflicted merge state
|
2018-10-12 16:22:10 +03:00
|
|
|
$ hg up -r 1 -q
|
2015-10-22 01:20:24 +03:00
|
|
|
$ touch z
|
|
|
|
$ hg add z
|
|
|
|
$ hg commit -m 'a commit that will merge without conflicts' -q
|
|
|
|
$ hg merge -r 79361b8cdbb -q
|
|
|
|
$ hg status
|
|
|
|
M a
|
|
|
|
|
|
|
|
# The repository is in an unfinished *merge* state.
|
|
|
|
# To continue: hg commit
|
2017-01-03 19:25:52 +03:00
|
|
|
# To abort: hg update --clean . (warning: this will discard uncommitted changes)
|
2015-10-22 01:20:24 +03:00
|
|
|
|
|
|
|
Test hg status is normal after merge commit (no output)
|
|
|
|
$ hg commit -m 'merge commit' -q
|
|
|
|
$ hg status
|
2015-11-27 16:16:53 +03:00
|
|
|
|
|
|
|
Test interrupted update state, without active bookmark and REV is a hash
|
2017-12-01 22:47:31 +03:00
|
|
|
$ breakupdate
|
|
|
|
$ hg update -C 2977a57ce863
|
2015-11-27 16:16:53 +03:00
|
|
|
$ hg status
|
|
|
|
|
|
|
|
# The repository is in an unfinished *update* state.
|
|
|
|
# To continue: hg update -C 2977a57ce863
|
2017-01-03 19:25:52 +03:00
|
|
|
# To abort: hg update --clean . (warning: this will discard uncommitted changes)
|
2015-11-27 16:16:53 +03:00
|
|
|
|
|
|
|
Test interrupted update state, with active bookmark and REV is a bookmark
|
|
|
|
$ hg bookmark b1
|
|
|
|
$ hg bookmark -r 79361b8cdbb5 b2
|
2017-12-01 22:47:31 +03:00
|
|
|
$ hg update b2
|
2015-11-27 16:16:53 +03:00
|
|
|
$ hg status
|
|
|
|
|
|
|
|
# The repository is in an unfinished *update* state.
|
|
|
|
# To continue: hg update b2
|
2017-01-03 19:25:52 +03:00
|
|
|
# To abort: hg update --clean b1 (warning: this will discard uncommitted changes)
|
2015-11-27 16:16:53 +03:00
|
|
|
|
|
|
|
Test update state can be reset using bookmark
|
2017-12-01 22:47:31 +03:00
|
|
|
$ hg update b1 -q
|
2015-11-27 16:16:53 +03:00
|
|
|
$ hg bookmark -d b1 -q
|
|
|
|
$ hg status
|
|
|
|
|
|
|
|
Test interrupted update state, without active bookmark and REV is specified using date
|
|
|
|
$ echo a >> a
|
|
|
|
$ hg commit --date "1234567890 0" -m m -q
|
2017-12-01 22:47:31 +03:00
|
|
|
$ hg update --date 1970-1-1 -q
|
2015-11-27 16:16:53 +03:00
|
|
|
$ hg status
|
|
|
|
|
|
|
|
# The repository is in an unfinished *update* state.
|
|
|
|
# To continue: hg update --date 1970-1-1 -q
|
2017-01-03 19:25:52 +03:00
|
|
|
# To abort: hg update --clean . (warning: this will discard uncommitted changes)
|
2015-11-27 16:16:53 +03:00
|
|
|
|
2017-12-01 22:47:31 +03:00
|
|
|
$ unbreakupdate
|
|
|
|
|
2015-11-27 16:16:53 +03:00
|
|
|
Test update state can be reset using .
|
|
|
|
$ hg update . -q
|
|
|
|
$ hg status
|
2019-04-15 16:52:12 +03:00
|
|
|
|
|
|
|
Test args escaping in continue command
|
|
|
|
$ breakupdate
|
|
|
|
$ hg bookmark b1
|
|
|
|
$ hg --config extensions.fsmonitor=! --config ui.ssh="ssh -oControlMaster=no" update -C 2977a57ce863
|
|
|
|
$ hg status
|
|
|
|
|
|
|
|
# The repository is in an unfinished *update* state.
|
|
|
|
# To continue: hg --config 'extensions.fsmonitor=!' --config 'ui.ssh=ssh -oControlMaster=no' update -C 2977a57ce863
|
|
|
|
# To abort: hg update --clean b1 (warning: this will discard uncommitted changes)
|
|
|
|
|
2020-06-02 18:04:29 +03:00
|
|
|
$ unbreakupdate
|
|
|
|
$ hg update --clean b1
|
|
|
|
0 files updated, 0 files merged, 0 files removed, 0 files unresolved
|
|
|
|
$ hg status
|
|
|
|
|
|
|
|
Test bisect search status (after cleaning up previous setup)
|
|
|
|
$ echo 'z' > z
|
|
|
|
$ hg commit -Am 'z' -q
|
|
|
|
$ hg bisect --bad
|
|
|
|
$ hg bisect --good 0efcea34f18a
|
|
|
|
Testing changeset 69a19f24e505 (5 changesets remaining, ~2 tests)
|
|
|
|
2 files updated, 0 files merged, 0 files removed, 0 files unresolved
|
|
|
|
$ hg status
|
|
|
|
|
|
|
|
# The repository is in an unfinished *bisect* state.
|
|
|
|
# Current bisect state: 1 good commit(s), 1 bad commit(s), 0 skip commit(s)
|
|
|
|
#
|
|
|
|
# Current Tracker: bad commit current good commit
|
|
|
|
# 547e426ae373...69a19f24e505...0efcea34f18a
|
|
|
|
# Commits remaining: 5
|
|
|
|
# Estimated bisects remaining: 3
|
|
|
|
# To mark the changeset good: hg bisect --good
|
|
|
|
# To mark the changeset bad: hg bisect --bad
|
|
|
|
# To abort: hg bisect --reset
|
|
|
|
|
|
|
|
Test hg status is normal after bisect reset
|
|
|
|
$ hg bisect --reset
|
|
|
|
$ hg status
|