John Florenadded /rce028bd313 years agoHistory
35 lines · 565 B · Text
RawDownload
#!/bin/rc rfork eif(! ~ $#* 1){	echo 'usage: patch/undo patch-name' >[1=2]	exit usage} if(! test -d /n/sources/patch){	rfork n	9fs sources} if(! test -d /n/sources/patch/$1){	echo 'no such patch' /n/sources/patch/$1 >[1=2]	exit nopatch} d=$1builtin cd /n/sources/patch/$1 || exit nopatchif(! patch/okay .){	echo 'bad patch: '$status >[1=2]	exit badpatch} fn xxx {	if(cmp $2.new $1){		echo cp /n/sources/patch/$d/$2.backup $1		cp $2.backup $1	}	if not		echo $1 has changed since patch was applied! >[2=1]}cat files | sed 's/^/xxx /' |rc 

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t