Index: patchconv/rapply.sh |
=================================================================== |
new file mode 100755 |
--- /dev/null |
+++ b/patchconv/rapply.sh |
@@ -0,0 +1,38 @@ |
+#!/bin/sh |
+# |
+# This file is part of Adblock Plus <https://adblockplus.org/>, |
+# Copyright (C) 2006-present eyeo GmbH |
+# |
+# Adblock Plus is free software: you can redistribute it and/or modify |
+# it under the terms of the GNU General Public License version 3 as |
+# published by the Free Software Foundation. |
+# |
+# Adblock Plus is distributed in the hope that it will be useful, |
+# but WITHOUT ANY WARRANTY; without even the implied warranty of |
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
+# GNU General Public License for more details. |
+# |
+# You should have received a copy of the GNU General Public License |
+# along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>. |
+ |
+set -eu |
+ |
+if [ $# -lt 1 ]; then |
+ echo "usage: rapply.sh PATCH" |
+ exit 1 |
+fi |
+ |
+if git st >/dev/null 2>&1; then |
+ IMPORT="git apply" |
+elif hg st >/dev/null 2>&1; then |
+ IMPORT="hg import --no-commit -" |
juliandoucette
2017/08/25 12:07:12
There is no --no-commit option for hg import?
(I'
Sebastian Noack
2017/08/25 12:12:18
There is, at least in Mercurial 4.0, which is incl
juliandoucette
2017/08/25 12:21:28
I'm using hg --version
Mercurial Distributed SCM (
Sebastian Noack
2017/08/25 13:49:53
I'm still confused why the --no-commit option is c
|
+else |
+ echo "No repository found in `pwd`" |
+ exit 2 |
+fi |
+ |
+if [ -f "$1" ]; then |
+ patchconv < "$1" | $IMPORT |
+else |
+ curl "$1" | patchconv | $IMPORT |
+fi |