sapling/tests/test-backup.t
Laurent Charignon e8aa27731b backups: fix compatibility issues with core
Summary:
hg backups has been broken since mid october (see 2b16ffcd3 in core)
This patch fixes it and adds a test for it.

Test Plan: Adds a new test

Reviewers: #sourcecontrol, ttung

Differential Revision: https://phabricator.fb.com/D2788217
2015-12-29 11:34:30 -08:00

35 lines
747 B
Perl

$ cat >> $HGRCPATH << EOF
> [extensions]
> backups=$TESTDIR/../backups.py
> strip=
> EOF
Setup repo
$ hg init repo
$ cd repo
Test backups list and recover
$ mkcommit() {
> echo "$1" > "$1"
> hg add "$1"
> hg ci -l $1
> }
$ mkcommit a
$ mkcommit b
$ hg strip .
0 files updated, 0 files merged, 1 files removed, 0 files unresolved
saved backup bundle to $TESTTMP/repo/.hg/strip-backup/d2ae7f538514-2953539b-backup.hg (glob)
$ hg backups
Recover commits using: hg backups --recover <commit hash>
* (glob)
d2ae7f538514 b
$ hg backups --recover d2ae7f538514
Unbundling d2ae7f538514
adding changesets
adding manifests
adding file changes
added 1 changesets with 1 changes to 1 files