mirror of
https://github.com/facebook/sapling.git
synced 2024-10-10 08:47:12 +03:00
0ba2c44d90
Summary: create `uncopy` command to unmark files that were copied using `copy`. Reviewed By: quark-zju Differential Revision: D28821574 fbshipit-source-id: c1c15f6fb2837cec529860aba70b516ddd794f10
65 lines
1.3 KiB
Perl
65 lines
1.3 KiB
Perl
set up test repo
|
|
|
|
$ hg init uncopytest
|
|
$ cd uncopytest
|
|
$ echo testcontents > testfile.txt
|
|
$ mkdir testdir
|
|
$ echo dircontents1 > testdir/dirfile1.txt
|
|
$ echo dircontents2 > testdir/dirfile2.txt
|
|
$ hg add -q
|
|
$ hg commit -m "initial commit"
|
|
|
|
uncopy a single file
|
|
|
|
$ hg copy testfile.txt copyfile.txt
|
|
$ hg status -C copyfile.txt
|
|
A copyfile.txt
|
|
testfile.txt
|
|
$ hg uncopy copyfile.txt
|
|
$ hg status -C copyfile.txt
|
|
A copyfile.txt
|
|
$ rm copyfile.txt
|
|
|
|
uncopy a directory
|
|
|
|
$ hg copy -q testdir copydir
|
|
$ hg status -C copydir
|
|
A copydir/dirfile1.txt
|
|
testdir/dirfile1.txt
|
|
A copydir/dirfile2.txt
|
|
testdir/dirfile2.txt
|
|
$ hg uncopy copydir
|
|
$ hg status -C copydir
|
|
A copydir/dirfile1.txt
|
|
A copydir/dirfile2.txt
|
|
$ rm -r copydir
|
|
|
|
uncopy by pattern
|
|
|
|
$ hg copy -q testfile.txt copyfile1.txt
|
|
$ hg copy -q testfile.txt copyfile2.txt
|
|
$ hg status -C copyfile1.txt copyfile2.txt
|
|
A copyfile1.txt
|
|
testfile.txt
|
|
A copyfile2.txt
|
|
testfile.txt
|
|
$ hg uncopy copyfile*
|
|
$ hg status -C copyfile1.txt copyfile2.txt
|
|
A copyfile1.txt
|
|
A copyfile2.txt
|
|
$ rm copyfile*
|
|
|
|
uncopy nonexistent file
|
|
|
|
$ hg uncopy notfound.txt
|
|
notfound.txt: $ENOENT$
|
|
[1]
|
|
|
|
uncopy a file that was not copied
|
|
|
|
$ echo othercontents > otherfile.txt
|
|
$ hg uncopy otherfile.txt
|
|
[1]
|
|
$ hg status -C otherfile.txt
|
|
? otherfile.txt
|