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 fb4377cf..8f666e6d 100644 --- a/git_config.py +++ b/git_config.py | |||
@@ -51,16 +51,24 @@ else: | |||
51 | from git_command import GitCommand | 51 | from git_command import GitCommand |
52 | from git_command import ssh_sock | 52 | from git_command import ssh_sock |
53 | from git_command import terminate_ssh_clients | 53 | from git_command import terminate_ssh_clients |
54 | from git_refs import R_CHANGES, R_HEADS, R_TAGS | ||
54 | 55 | ||
55 | R_HEADS = 'refs/heads/' | ||
56 | R_TAGS = 'refs/tags/' | ||
57 | ID_RE = re.compile(r'^[0-9a-f]{40}$') | 56 | ID_RE = re.compile(r'^[0-9a-f]{40}$') |
58 | 57 | ||
59 | REVIEW_CACHE = dict() | 58 | REVIEW_CACHE = dict() |
60 | 59 | ||
60 | def IsChange(rev): | ||
61 | return rev.startswith(R_CHANGES) | ||
62 | |||
61 | def IsId(rev): | 63 | def IsId(rev): |
62 | return ID_RE.match(rev) | 64 | return ID_RE.match(rev) |
63 | 65 | ||
66 | def IsTag(rev): | ||
67 | return rev.startswith(R_TAGS) | ||
68 | |||
69 | def IsImmutable(rev): | ||
70 | return IsChange(rev) or IsId(rev) or IsTag(rev) | ||
71 | |||
64 | def _key(name): | 72 | def _key(name): |
65 | parts = name.split('.') | 73 | parts = name.split('.') |
66 | if len(parts) < 2: | 74 | if len(parts) < 2: |