Procházet zdrojové kódy

git is slightly more verbose now; comment fix for RC

tags/v0.1
Ben Kurtovic před 13 roky
rodič
revize
32e20d1a2f
2 změnil soubory, kde provedl 9 přidání a 4 odebrání
  1. +8
    -2
      irc/commands/git.py
  2. +1
    -2
      irc/rc.py

+ 8
- 2
irc/commands/git.py Zobrazit soubor

@@ -143,11 +143,17 @@ class Git(BaseCommand):
self.connection.reply(self.data, "done; no new changes.")
else:
changes = re.findall("\s*((.*?)\sfile(.*?)tions?\(-\))", result)[0][0] # find the changes
self.connection.reply(self.data, "done; %s." % changes)
try:
remote = self.exec_shell("git config --get branch.%s.remote" % branch)
url = self.exec_shell("git config --get remote.%s.url" % remote)
self.connection.reply(self.data, "done; %s. [from %s]" % (changes, url))
except subprocess.CalledProcessError: # something in .git/config is not specified correctly, so we cannot get the remote's url
self.connection.reply(self.data, "done; %s." % changes)

def do_status(self):
"""check whether we have anything to pull"""
self.connection.reply(self.data, "checking remote for updates...")
last = self.exec_shell("git log -n 1 --pretty=\"%ar\"")
self.connection.reply(self.data, "last commit was %s. Checking remote for updates..." % last)
result = self.exec_shell("git fetch --dry-run")
if not result:
self.connection.reply(self.data, "local copy is up-to-date with remote.")


+ 1
- 2
irc/rc.py Zobrazit soubor

@@ -17,8 +17,7 @@ class RC(object):
self.msg = msg
self.is_edit = True

# page name of the modified page
# 'M' for minor edit, 'B' for bot edit, 'create' for a user creation log entry...
# flags: 'M' for minor edit, 'B' for bot edit, 'create' for a user creation log entry...
try:
page, flags, url, user, comment = re.findall("\A\[\[(.*?)\]\]\s(.*?)\s(http://.*?)\s\*\s(.*?)\s\*\s(.*?)\Z", msg)[0]
except IndexError: # we're probably missing the http:// part, because it's a log entry, which lacks a url


Načítá se…
Zrušit
Uložit