Left: | ||
Right: |
LEFT | RIGHT |
---|---|
1 #!/bin/sh | 1 #!/bin/sh |
2 # | 2 # |
3 # This file is part of Adblock Plus <https://adblockplus.org/>, | 3 # This file is part of Adblock Plus <https://adblockplus.org/>, |
4 # Copyright (C) 2006-present eyeo GmbH | 4 # Copyright (C) 2006-present eyeo GmbH |
5 # | 5 # |
6 # Adblock Plus is free software: you can redistribute it and/or modify | 6 # Adblock Plus is free software: you can redistribute it and/or modify |
7 # it under the terms of the GNU General Public License version 3 as | 7 # it under the terms of the GNU General Public License version 3 as |
8 # published by the Free Software Foundation. | 8 # published by the Free Software Foundation. |
9 # | 9 # |
10 # Adblock Plus is distributed in the hope that it will be useful, | 10 # Adblock Plus is distributed in the hope that it will be useful, |
11 # but WITHOUT ANY WARRANTY; without even the implied warranty of | 11 # but WITHOUT ANY WARRANTY; without even the implied warranty of |
12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 12 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
13 # GNU General Public License for more details. | 13 # GNU General Public License for more details. |
14 # | 14 # |
15 # You should have received a copy of the GNU General Public License | 15 # You should have received a copy of the GNU General Public License |
16 # along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>. | 16 # along with Adblock Plus. If not, see <http://www.gnu.org/licenses/>. |
17 | 17 |
18 set -eu | 18 set -eu |
19 | 19 |
20 if [ $# -lt 1 ]; then | 20 if [ $# -lt 1 ]; then |
21 echo "usage: rapply.sh PATCH" | 21 echo "usage: rapply.sh PATCH" |
22 exit 1 | 22 exit 1 |
23 fi | 23 fi |
24 | 24 |
25 if git st >/dev/null 2>&1; then | 25 if git st >/dev/null 2>&1; then |
26 IMPORT="git apply" | 26 IMPORT="git apply" |
27 elif hg st >/dev/null 2>&1; then | 27 elif hg st >/dev/null 2>&1; then |
28 IMPORT="hg import --no-commit -" | 28 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
| |
29 else | 29 else |
30 echo "No repository found in `pwd`" | 30 echo "No repository found in `pwd`" |
31 exit 2 | 31 exit 2 |
32 fi | 32 fi |
33 | 33 |
34 BASEDIR=$(dirname "$0") | |
35 if [ -f "$BASEDIR/patchconv.py" ]; then | |
36 alias patchconv="$BASEDIR/patchconv.py" | |
37 fi | |
38 | |
34 if [ -f "$1" ]; then | 39 if [ -f "$1" ]; then |
35 patchconv < "$1" | $IMPORT | 40 patchconv < "$1" | $IMPORT |
36 else | 41 else |
37 curl "$1" | patchconv | $IMPORT | 42 curl "$1" | patchconv | $IMPORT |
38 fi | 43 fi |
LEFT | RIGHT |