summaryrefslogtreecommitdiffstats
path: root/git_config.py
diff options
context:
space:
mode:
Diffstat (limited to 'git_config.py')
-rw-r--r--git_config.py12
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:
51from git_command import GitCommand 51from git_command import GitCommand
52from git_command import ssh_sock 52from git_command import ssh_sock
53from git_command import terminate_ssh_clients 53from git_command import terminate_ssh_clients
54from git_refs import R_CHANGES, R_HEADS, R_TAGS
54 55
55R_HEADS = 'refs/heads/'
56R_TAGS = 'refs/tags/'
57ID_RE = re.compile(r'^[0-9a-f]{40}$') 56ID_RE = re.compile(r'^[0-9a-f]{40}$')
58 57
59REVIEW_CACHE = dict() 58REVIEW_CACHE = dict()
60 59
60def IsChange(rev):
61 return rev.startswith(R_CHANGES)
62
61def IsId(rev): 63def IsId(rev):
62 return ID_RE.match(rev) 64 return ID_RE.match(rev)
63 65
66def IsTag(rev):
67 return rev.startswith(R_TAGS)
68
69def IsImmutable(rev):
70 return IsChange(rev) or IsId(rev) or IsTag(rev)
71
64def _key(name): 72def _key(name):
65 parts = name.split('.') 73 parts = name.split('.')
66 if len(parts) < 2: 74 if len(parts) < 2: