diff options
Diffstat (limited to 'git_config.py')
-rw-r--r-- | git_config.py | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/git_config.py b/git_config.py index e00f6be2..8c247394 100644 --- a/git_config.py +++ b/git_config.py | |||
@@ -50,16 +50,24 @@ else: | |||
50 | from git_command import GitCommand | 50 | from git_command import GitCommand |
51 | from git_command import ssh_sock | 51 | from git_command import ssh_sock |
52 | from git_command import terminate_ssh_clients | 52 | from git_command import terminate_ssh_clients |
53 | from git_refs import R_CHANGES, R_HEADS, R_TAGS | ||
53 | 54 | ||
54 | R_HEADS = 'refs/heads/' | ||
55 | R_TAGS = 'refs/tags/' | ||
56 | ID_RE = re.compile(r'^[0-9a-f]{40}$') | 55 | ID_RE = re.compile(r'^[0-9a-f]{40}$') |
57 | 56 | ||
58 | REVIEW_CACHE = dict() | 57 | REVIEW_CACHE = dict() |
59 | 58 | ||
59 | def IsChange(rev): | ||
60 | return rev.startswith(R_CHANGES) | ||
61 | |||
60 | def IsId(rev): | 62 | def IsId(rev): |
61 | return ID_RE.match(rev) | 63 | return ID_RE.match(rev) |
62 | 64 | ||
65 | def IsTag(rev): | ||
66 | return rev.startswith(R_TAGS) | ||
67 | |||
68 | def IsImmutable(rev): | ||
69 | return IsChange(rev) or IsId(rev) or IsTag(rev) | ||
70 | |||
63 | def _key(name): | 71 | def _key(name): |
64 | parts = name.split('.') | 72 | parts = name.split('.') |
65 | if len(parts) < 2: | 73 | if len(parts) < 2: |