tests: move showgraph() to tinit.sh

Summary:
It's duplicate in all the fbamend tests, and I want to make a change to it. Rather than duplicate it, let's fold it into `tinit`.

In the future, I'll unify this with tglog, printdag, etc.

Reviewed By: quark-zju

Differential Revision: D9323267

fbshipit-source-id: c1db0f2f22ffadbcb8ad3c0bde329798db06f089
This commit is contained in:
Phil Cohen 2018-08-14 23:13:15 -07:00 committed by Facebook Github Bot
parent 0ba172a19e
commit d56ff5d1de
9 changed files with 4 additions and 24 deletions

View File

@ -7,9 +7,6 @@ Set up test environment.
> [experimental] > [experimental]
> evolution = createmarkers, allowunstable > evolution = createmarkers, allowunstable
> EOF > EOF
$ showgraph() {
> hg log --graph -T "{rev} {desc|firstline}" | sed \$d
> }
$ reset() { $ reset() {
> cd .. > cd ..
> rm -rf repo > rm -rf repo

View File

@ -6,9 +6,6 @@ Set up test environment.
> [experimental] > [experimental]
> evolution = createmarkers, allowunstable > evolution = createmarkers, allowunstable
> EOF > EOF
$ showgraph() {
> hg log --graph -T "{rev} {desc|firstline}" | sed \$d
> }
Test that rebased commits that would cause instability are inhibited. Test that rebased commits that would cause instability are inhibited.
$ hg init repo && cd repo $ hg init repo && cd repo

View File

@ -9,9 +9,6 @@
> hg add "$1" > hg add "$1"
> hg ci -m "add $1" > hg ci -m "add $1"
> } > }
$ showgraph() {
> hg log --graph -T "{rev} {desc|firstline}" | sed \$d
> }
Test invalid value for amend.autorestack Test invalid value for amend.autorestack
$ newrepo $ newrepo

View File

@ -8,9 +8,6 @@
> hg add "$1" > hg add "$1"
> hg ci -m "add $1" > hg ci -m "add $1"
> } > }
$ showgraph() {
> hg log --graph -T "{rev} {desc|firstline}" | sed \$d
> }
Test situation with divergence. Restack should rebase unstable children Test situation with divergence. Restack should rebase unstable children
onto the newest successor of their parent. onto the newest successor of their parent.

View File

@ -8,9 +8,6 @@
> hg add "$1" > hg add "$1"
> hg ci -m "add $1" > hg ci -m "add $1"
> } > }
$ showgraph() {
> hg log --graph -T "{rev} {desc|firstline}" | sed \$d
> }
Restack does topological sort and only rebases "D" once: Restack does topological sort and only rebases "D" once:

View File

@ -10,9 +10,6 @@ Set up test environment.
> hg add "$1" > hg add "$1"
> hg ci -m "add $1" > hg ci -m "add $1"
> } > }
$ showgraph() {
> hg log --graph -T "{rev} {desc|firstline}" | sed \$d
> }
$ hg init restack && cd restack $ hg init restack && cd restack
Note: Repositories populated by `hg debugbuilddag` don't seem to Note: Repositories populated by `hg debugbuilddag` don't seem to

View File

@ -24,9 +24,6 @@ Set up test environment.
> hg init repo > hg init repo
> cd repo > cd repo
> } > }
$ showgraph() {
> hg log --graph -T "{rev} {desc|firstline}" | sed \$d
> }
Initialize repo. Initialize repo.
$ hg init repo && cd repo $ hg init repo && cd repo

View File

@ -9,9 +9,6 @@ This test confirms cacheinvalidation in hg fold.
> [experimental] > [experimental]
> evolution = createmarkers, allowunstable > evolution = createmarkers, allowunstable
> EOF > EOF
$ showgraph() {
> hg log --graph -T "{rev} {desc|firstline}" | sed \$d
> }
$ reset() { $ reset() {
> cd .. > cd ..
> rm -rf repo > rm -rf repo

View File

@ -47,3 +47,7 @@ drawdag() {
setconfig() { setconfig() {
python "$RUNTESTDIR/setconfig.py" "$@" python "$RUNTESTDIR/setconfig.py" "$@"
} }
showgraph() {
hg log --graph -T "{rev} {desc|firstline}" | sed \$d
}