fpull: Support git versions older than 1.9
Those versions don't support the --rebase=preserve option of git pull.
This commit is contained in:
parent
24851f3c56
commit
1ac59cea78
@ -7167,12 +7167,11 @@ def vote(cli, nick, chan, rest):
|
|||||||
def fpull(cli, nick, chan, rest):
|
def fpull(cli, nick, chan, rest):
|
||||||
"""Pulls from the repository to update the bot."""
|
"""Pulls from the repository to update the bot."""
|
||||||
|
|
||||||
args = ["git", "pull", "--stat", "--rebase=preserve"]
|
commands = ["git fetch",
|
||||||
|
"git rebase --stat --preserve-merges"]
|
||||||
|
|
||||||
if rest:
|
for command in commands:
|
||||||
args += rest.split(" ")
|
child = subprocess.Popen(command.split(),
|
||||||
|
|
||||||
child = subprocess.Popen(args,
|
|
||||||
stdout=subprocess.PIPE,
|
stdout=subprocess.PIPE,
|
||||||
stderr=subprocess.PIPE)
|
stderr=subprocess.PIPE)
|
||||||
(out, err) = child.communicate()
|
(out, err) = child.communicate()
|
||||||
@ -7192,9 +7191,9 @@ def fpull(cli, nick, chan, rest):
|
|||||||
cause = "status"
|
cause = "status"
|
||||||
|
|
||||||
if chan == nick:
|
if chan == nick:
|
||||||
cli.msg(nick, "Process %s exited with %s %d" % (args, cause, ret))
|
cli.msg(nick, "Process %s exited with %s %d" % (command, cause, ret))
|
||||||
else:
|
else:
|
||||||
pm(cli, nick, "Process %s exited with %s %d" % (args, cause, ret))
|
pm(cli, nick, "Process %s exited with %s %d" % (command, cause, ret))
|
||||||
|
|
||||||
@cmd("fsend", admin_only=True, pm=True)
|
@cmd("fsend", admin_only=True, pm=True)
|
||||||
def fsend(cli, nick, chan, rest):
|
def fsend(cli, nick, chan, rest):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user