sapling/eden/hg-server/tests/test-rebase-partial.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

104 lines
2.0 KiB
Perl

#chg-compatible
Tests rebasing with part of the rebase set already in the
destination (issue5422)
$ configure mutation-norecord
$ enable rebase
$ rebasewithdag() {
> N=$((N + 1))
> hg init repo$N && cd repo$N
> hg debugdrawdag
> hg rebase "$@" && tglog
> cd ..
> return $r
> }
Rebase two commits, of which one is already in the right place
$ rebasewithdag -r C+D -d B <<EOF
> C
> |
> B D
> |/
> A
> EOF
rebasing b18e25de2cf5 "D" (D)
already rebased 26805aba1e60 "C" (C)
o fe3b4c6498fa 'D' D
o 26805aba1e60 'C' C
o 112478962961 'B' B
o 426bada5c675 'A' A
Can collapse commits even if one is already in the right place
$ rebasewithdag --collapse -r C+D -d B <<EOF
> C
> |
> B D
> |/
> A
> EOF
rebasing b18e25de2cf5 "D" (D)
rebasing 26805aba1e60 "C" (C)
o a2493f4ace65 'Collapsed revision
│ * D
│ * C' C D
o 112478962961 'B' B
o 426bada5c675 'A' A
Rebase with "holes". The commits after the hole should end up on the parent of
the hole (B below), not on top of the destination (A).
$ rebasewithdag -r B+D -d A <<EOF
> D
> |
> C
> |
> B
> |
> A
> EOF
already rebased 112478962961 "B" (B)
rebasing f585351a92f8 "D" (D)
o 1e6da8103bc7 'D' D
o 26805aba1e60 'C' C
o 112478962961 'B' B
o 426bada5c675 'A' A
Abort doesn't lose the commits that were already in the right place
$ newrepo abort
$ hg debugdrawdag <<EOF
> C
> |
> B D # B/file = B
> |/ # D/file = D
> A
> EOF
$ hg rebase -r C+D -d B
rebasing ef8c0fe0897b "D" (D)
merging file
warning: 1 conflicts while merging file! (edit, then use 'hg resolve --mark')
unresolved conflicts (see hg resolve, then hg rebase --continue)
[1]
$ hg rebase --abort
rebase aborted
$ tglog
o 79f6d6ab7b14 'C' C
│ o ef8c0fe0897b 'D' D
│ │
o │ 594087dbaf71 'B' B
├─╯
o 426bada5c675 'A' A