sapling/eden/hg-server/tests/test-fb-hgext-morestatus.t
Durham Goode 98d9269874 server: copy hg to a new hg-server directory
Summary:
Create a fork of the Mercurial code that we can use to build server
rpms. The hg servers will continue to exist for a few more months while we move
the darkstorm and ediscovery use cases off them. In the mean time, we want to
start making breaking changes to the client, so let's create a stable copy of
the hg code to produce rpms for the hg servers.

The fork is based off c7770c78d, the latest hg release.

This copies the files as is, then adds some minor tweaks to get it to build:
- Disables some lint checks that appear to be bypassed by path
- sed replace eden/scm with eden/hg-server
- Removed a dependency on scm/telemetry from the edenfs-client tests since
  scm/telemetry pulls in the original eden/scm/lib/configparser which conflicts
  with the hg-server conflict parser.

allow-large-files

Reviewed By: quark-zju

Differential Revision: D27632557

fbshipit-source-id: b2f442f4ec000ea08e4d62de068750832198e1f4
2021-04-09 10:09:06 -07:00

314 lines
8.9 KiB
Perl

#chg-compatible
$ configure mutation-norecord
$ enable morestatus fbhistedit histedit rebase reset
$ setconfig morestatus.show=true
$ cat >> $TESTTMP/breakupdate.py << EOF
> import sys
> from edenscm.mercurial import merge
> def extsetup(ui):
> merge.applyupdates = lambda *args, **kwargs: sys.exit()
> EOF
$ breakupdate() {
> setconfig extensions.breakupdate="$TESTTMP/breakupdate.py"
> }
$ unbreakupdate() {
> disable breakupdate
> }
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.
# To continue: hg histedit --continue
# To abort: hg histedit --abort
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.
# Current bisect state: 1 good commit(s), 0 bad commit(s), 0 skip commit(s)
# To mark the changeset good: hg bisect --good
# To mark the changeset bad: hg bisect --bad
# To abort: hg bisect --reset
Verify that suppressing a morestatus state warning works with the config knob:
$ hg status --config morestatus.skipstates=bisect
Test hg status is normal after bisect reset
$ hg bisect --reset
$ hg status
Test graft state
$ hg up -q -r 'max(desc(a))'
$ echo '' > a
$ hg commit -q -m 'remove content'
$ hg up -q -r 'max(desc(a))'
$ echo 'ab' > a
$ hg commit -q -m 'add content'
$ hg graft -q 2977a57
warning: 1 conflicts while merging a! (edit, then use 'hg resolve --mark')
abort: unresolved conflicts, can't continue
(use 'hg resolve' and 'hg graft --continue')
[255]
$ hg status
M a
? a.orig
# The repository is in an unfinished *graft* state.
# Unresolved merge conflicts:
#
# a
#
# To mark files as resolved: hg resolve --mark FILE
# To continue: hg graft --continue
# To abort: hg update --clean . (warning: this will discard uncommitted changes)
Test hg status is normal after graft abort
$ hg up --clean -q
$ hg status
? a.orig
$ rm a.orig
Test unshelve state
$ enable shelve
$ hg reset ".^" -q
$ hg shelve -q
$ hg up -r 2977a57 -q
$ hg unshelve -q
warning: 1 conflicts while merging a! (edit, then use 'hg resolve --mark')
unresolved conflicts (see 'hg resolve', then 'hg unshelve --continue')
[1]
$ hg status
M a
? a.orig
# The repository is in an unfinished *unshelve* state.
# Unresolved merge conflicts:
#
# a
#
# To mark files as resolved: hg resolve --mark FILE
# To continue: hg unshelve --continue
# To abort: hg unshelve --abort
Test hg status is normal after unshelve abort
$ hg unshelve --abort
rebase aborted
unshelve of 'default' aborted
$ hg status
? a.orig
$ rm a.orig
Test rebase state
$ echo "rebase=" >> $HGRCPATH
$ hg up -r 0efcea34f18aa8f87dc63b4c37b7c494bc778b03 -q
$ echo 'ab' > a
$ hg commit -q -m 'add content'
$ hg rebase -s 2977a57 -d . -q
warning: 1 conflicts while merging a! (edit, then use 'hg resolve --mark')
unresolved conflicts (see hg resolve, then hg rebase --continue)
[1]
$ hg status
M a
? a.orig
# The repository is in an unfinished *rebase* state.
# 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)
continue: hg rebase --continue
$ 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
Test rebase with an interrupted update:
$ breakupdate
$ hg rebase -s 2977a57ce863 -d 79361b8cdbb5 -q
$ unbreakupdate
$ 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
Test conflicted merge state
$ hg merge -q
warning: 1 conflicts while merging a! (edit, then use 'hg resolve --mark')
[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
# To abort: hg update --clean . (warning: this will discard uncommitted changes)
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 ../..
Test hg status is normal after merge abort
$ hg update --clean -q
$ hg status
? a.orig
$ rm a.orig
Test non-conflicted merge state
$ hg up -r 0efcea34f18aa8f87dc63b4c37b7c494bc778b03 -q
$ 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
# To abort: hg update --clean . (warning: this will discard uncommitted changes)
Test hg status is normal after merge commit (no output)
$ hg commit -m 'merge commit' -q
$ hg status
Test interrupted update state, without active bookmark and REV is a hash
$ breakupdate
$ hg update -C 2977a57ce863
$ hg status
# The repository is in an unfinished *update* state.
# To continue: hg update -C 2977a57ce863
# To abort: hg update --clean . (warning: this will discard uncommitted changes)
Test interrupted update state, with active bookmark and REV is a bookmark
$ hg bookmark b1
$ hg bookmark -r 79361b8cdbb5 b2
$ hg update b2
$ hg status
# The repository is in an unfinished *update* state.
# To continue: hg update b2
# To abort: hg update --clean b1 (warning: this will discard uncommitted changes)
Test update state can be reset using bookmark
$ hg update b1 -q
$ 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
$ hg update --date 1970-1-1 -q
$ hg status
# The repository is in an unfinished *update* state.
# To continue: hg update --date 1970-1-1 -q
# To abort: hg update --clean . (warning: this will discard uncommitted changes)
$ unbreakupdate
Test update state can be reset using .
$ hg update . -q
$ hg status
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)
$ 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