mirror of
https://github.com/facebook/sapling.git
synced 2024-10-10 00:45:18 +03:00
72e331f593
Summary: There was a bug where rebasing a commit that contained a file that was not currently in the working copy would cause an exception. This is because the 'temporarily include a file' logic tries to bring the file back to life immediately, regardless of if the file actually exists yet or not (it may be an incoming file from the upcoming merge, so it doesn't exist yet). Test Plan: Added a test Reviewers: sid0, rmcelroy, pyd, lcharignon Reviewed By: lcharignon Differential Revision: https://phabricator.fb.com/D2083802 Signature: t1:2083802:1432075849:7a90c94a97322ca619d481477fcc8812e7a26e93
63 lines
1.4 KiB
Perl
63 lines
1.4 KiB
Perl
test merging things outside of the sparse checkout
|
|
|
|
$ hg init myrepo
|
|
$ cd myrepo
|
|
$ cat > .hg/hgrc <<EOF
|
|
> [extensions]
|
|
> sparse=$(dirname $TESTDIR)/sparse.py
|
|
> EOF
|
|
|
|
$ echo foo > foo
|
|
$ echo bar > bar
|
|
$ hg add foo bar
|
|
$ hg commit -m initial
|
|
|
|
$ hg branch feature
|
|
marked working directory as branch feature
|
|
(branches are permanent and global, did you want a bookmark?)
|
|
$ echo bar2 >> bar
|
|
$ hg commit -m 'feature - bar2'
|
|
|
|
$ hg update -q default
|
|
$ hg sparse --exclude 'bar**'
|
|
|
|
$ hg merge feature
|
|
temporarily included 1 file(s) in the sparse checkout for merging
|
|
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
|
|
(branch merge, don't forget to commit)
|
|
|
|
Verify bar was merged temporarily
|
|
|
|
$ ls
|
|
bar
|
|
foo
|
|
$ hg status
|
|
M bar
|
|
|
|
Verify bar disappears automatically when the working copy becomes clean
|
|
|
|
$ hg commit -m "merged"
|
|
cleaned up 1 temporarily added file(s) from the sparse checkout
|
|
$ hg status
|
|
$ ls
|
|
foo
|
|
|
|
$ hg cat -r . bar
|
|
bar
|
|
bar2
|
|
|
|
Test merging things outside of the sparse checkout that are not in the working
|
|
copy
|
|
|
|
$ hg strip -q -r . --config extensions.strip=
|
|
$ hg up -q feature
|
|
$ touch branchonly
|
|
$ hg ci -Aqm 'add branchonly'
|
|
|
|
$ hg up -q default
|
|
$ hg sparse -X branchonly
|
|
$ hg merge feature
|
|
temporarily included 2 file(s) in the sparse checkout for merging
|
|
2 files updated, 0 files merged, 0 files removed, 0 files unresolved
|
|
(branch merge, don't forget to commit)
|