blob: 02d0c6cd49961b35819420d819d15236df6039ad (
plain) (
tree)
|
|
$ mkdir patches
$ mkdir sub
$ echo f1 > sub/f
$ echo g1 > sub/g
$ quilt new p.diff
> Patch patches/p.diff is now on top
$ quilt add sub/f sub/g sub/h
> File sub/f added to patch patches/p.diff
> File sub/g added to patch patches/p.diff
> File sub/h added to patch patches/p.diff
$ echo h1 > sub/h
$ quilt revert sub/h
> Changes to sub/h in patch patches/p.diff reverted
$ quilt diff -z
# Our patch modifies file f, deletes file g and creates file h
$ echo f2 > sub/f
$ rm -f sub/g
$ echo h2 > sub/h
$ quilt refresh
> Refreshed patch patches/p.diff
# Check if we can revert modifications
$ cd sub
$ echo f3 > f
$ echo h3 > h
$ quilt revert f g h
> Changes to sub/f in patch ../patches/p.diff reverted
> File sub/g is unchanged
> Changes to sub/h in patch ../patches/p.diff reverted
$ quilt diff -z
# Check if we can revert file creation
$ echo g3 > g
$ quilt revert f g
> File sub/f is unchanged
> Changes to sub/g in patch ../patches/p.diff reverted
$ quilt diff -z
$ [ ! -e g ] || echo "File sub/g shouldn't exist"
# Check if we can revert file deletion
$ rm f h
$ quilt revert f h
> Changes to sub/f in patch ../patches/p.diff reverted
> Changes to sub/h in patch ../patches/p.diff reverted
$ quilt diff -z
$ [ -e f ] || echo "File sub/f should exist"
$ [ -e h ] || echo "File sub/h should exist"
|