forked from gil9red/SimplePyScripts
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcommit_watcher.py
More file actions
38 lines (26 loc) · 957 Bytes
/
Copy pathcommit_watcher.py
File metadata and controls
38 lines (26 loc) · 957 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = "ipetrash"
import time
import config
from common import get_log_list
url = config.URL_SVN
last_log = get_log_list(url, limit=1)[0]
last_revision = last_log.revision
print(
f'Start from commit rev{last_revision} by {last_log.author}: "{repr(last_log.msg)}" in {last_log.date}'
)
while True:
log_list = get_log_list(url, revision_from=last_revision)
if len(log_list) > 1:
# Первым в списке будет коммит с ревизией revision_from
log_list = log_list[1:]
last_log = log_list[-1]
if last_revision != last_log.revision:
print(
f'commits +{len(log_list)} from: rev{last_revision} by {last_log.author}: '
f'"{repr(last_log.msg)}" in {last_log.date}....{log_list}\n'
)
last_revision = last_log.revision
# Every 10 minutes
time.sleep(60 * 10)