Преглед на файлове

Fix status subcommand again.

tags/v0.1^2
Ben Kurtovic преди 12 години
родител
ревизия
c5a74254e7
променени са 1 файла, в които са добавени 6 реда и са изтрити 7 реда
  1. +6
    -7
      earwigbot/commands/git.py

+ 6
- 7
earwigbot/commands/git.py Целия файл

@@ -193,14 +193,14 @@ class Command(BaseCommand):
updated = [info for info in result if info.flags != info.HEAD_UPTODATE]

if updated:
update = ", ".join([info.ref.remote_head for info in updated])
branches = ", ".join([info.ref.remote_head for info in updated])
msg = "done; updates to \x0302{0}\x0301 (from {1})."
self.reply(self.data, msg.format(update, remote.url))
self.reply(self.data, msg.format(branches, remote.url))
else:
self.reply(self.data, "done; no new changes.")

def do_status(self):
"""Check whether we have anything to pull."""
"""Check if we have anything to pull."""
remote = self.get_remote()
if not remote:
return
@@ -209,10 +209,9 @@ class Command(BaseCommand):
updated = [info for info in result if info.flags != info.HEAD_UPTODATE]

if updated:
latest = max([info.commit.committed_date for info in updated])
remote_since = self.get_time_since(latest)
msg = "last local commit was \x02{0}\x0F ago; last remote commit was \x02{1}\x0F ago."
self.reply(self.data, msg.format(since, remote_since))
branches = ", ".join([info.ref.remote_head for info in updated])
msg = "last local commit was \x02{0}\x0F ago; updates to \x0302{1}\x0301."
self.reply(self.data, msg.format(since, branches))
else:
msg = "last commit was \x02{0}\x0F ago. Local copy is up-to-date with remote."
self.reply(self.data, msg.format(since))

Зареждане…
Отказ
Запис