sapling/tests/test-fastpartialmatch-evolve.t
Stanislau Hlebik 68889ae8f4 fastpartialmatch: add amended commits to the index
Summary:
Upstream mercurial doesn't run hooks for temporary amended commits
(see https://bz.mercurial-scm.org/show_bug.cgi?id=3501 and
c2ca20984e3c9f30d73f0f35c35904b64edbd692). No other hook contains info about
temporary amended commits.

Let's wrap localrepository.commit() function and add missing commits inside
this wrapper.

Test Plan: arc unit

Reviewers: #mercurial, durham

Reviewed By: durham

Subscribers: durham, mjpieters, #sourcecontrol

Differential Revision: https://phabricator.intern.facebook.com/D4634950

Tasks: 16387175

Signature: t1:4634950:1488399457:1d299c6ad3cfd418dda32a7ec20c60290f8d7778
2017-03-02 01:14:09 -08:00

71 lines
1.6 KiB
Perl

$ mkcommit() {
> echo "$1" > "$1"
> hg add "$1"
> hg ci -m "$1"
> }
$ extpath=`dirname $TESTDIR`
$ . $TESTDIR/require-ext.sh evolve
$ cat >> $HGRCPATH << EOF
> [extensions]
> fastpartialmatch=$extpath/hgext3rd/fastpartialmatch.py
> strip=
> histedit=
> evolve=
> [experimental]
> evolution=createmarkers
> evolutioncommands=obsolete
> [ui]
> ssh = python "$TESTDIR/dummyssh"
> EOF
$ hg init repo
$ cd repo
$ mkcommit firstcommit
$ hg prune .
0 files updated, 0 files merged, 1 files removed, 0 files unresolved
working directory now at 000000000000
1 changesets pruned
$ hg debugrebuildpartialindex
$ hg debugcheckpartialindex
$ mkcommit first
$ hg debugcheckpartialindex
$ hg prune -q .
$ hg debugcheckpartialindex
Try histedit
$ mkcommit second
$ mkcommit third
$ mkcommit fourth
$ hg log --graph
@ changeset: 4:d5e85d22a345
| tag: tip
| user: test
| date: Thu Jan 01 00:00:00 1970 +0000
| summary: fourth
|
o changeset: 3:a5b4be173947
| user: test
| date: Thu Jan 01 00:00:00 1970 +0000
| summary: third
|
o changeset: 2:be6305906393
parent: -1:000000000000
user: test
date: Thu Jan 01 00:00:00 1970 +0000
summary: second
$ hg histedit --commands - <<EOF
> pick d5e85d22a345 3 fourth
> pick a5b4be173947 2 third
> pick be6305906393 1 second
> EOF
$ hg debugcheckpartialindex
Made commit, then amend it. Check partial index
$ mkcommit toamend
$ echo 1 > toamend
$ hg commit --amend -m amended
$ hg debugcheckpartialindex