2018-10-12 16:22:10 +03:00
|
|
|
$ enable obsstore
|
2015-10-02 06:17:28 +03:00
|
|
|
$ cat >> $HGRCPATH << EOF
|
|
|
|
> [morestatus]
|
|
|
|
> show=True
|
|
|
|
> [extensions]
|
2018-01-09 14:06:09 +03:00
|
|
|
> morestatus=
|
|
|
|
> fbhistedit=
|
2016-01-08 05:30:24 +03:00
|
|
|
> histedit=
|
2017-10-17 21:56:27 +03:00
|
|
|
> rebase=
|
2018-01-09 14:06:09 +03:00
|
|
|
> reset=
|
2015-10-02 06:17:28 +03:00
|
|
|
> EOF
|
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() {
|
|
|
|
> cat >> .hg/hgrc <<EOF
|
|
|
|
> [extensions]
|
|
|
|
> breakupdate=$TESTTMP/breakupdate.py
|
|
|
|
> EOF
|
|
|
|
> }
|
|
|
|
$ unbreakupdate() {
|
|
|
|
> cat >> .hg/hgrc <<EOF
|
|
|
|
> [extensions]
|
|
|
|
> breakupdate=!
|
|
|
|
> EOF
|
|
|
|
> }
|
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.
|
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
|
|
|
|
$ echo "shelve=" >> $HGRCPATH
|
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)
|
|
|
|
|