blob: 2eca81f6076afd45dc6823619d9b1846a843ba25 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
from flask import url_for
from srht.config import get_origin
def clone_urls(repo):
"""Returns the readonly and read/write URL for a given repo."""
base = (get_origin("git.sr.ht", external=True)
.replace("http://", "")
.replace("https://", ""))
return [
url.format(base, repo.owner.canonical_name, repo.name)
for url in ["https://{}/{}/{}", "git@{}:{}/{}"]
]
def log_rss_url(repo, ref=None):
ref = ref if ref != "master" else None
return url_for("repo.log_rss",
owner=repo.owner.canonical_name,
repo=repo.name,
ref=ref)
def refs_rss_url(repo):
return url_for("repo.refs_rss",
owner=repo.owner.canonical_name,
repo=repo.name)
|