From 7ecf58cf8123e136ba67f866213c0a26873b4fcf Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Mar 20 2017 12:24:25 +0000 Subject: Remove mentioning if a commit is in master on the front page This had a few problems: - We were comparing master with master of the parent repo, without taking into account projects not using master for their main branch - We were comparing master with master of the parent repo, but for regular project (ie not fork) we were thus comparing it to itself - The commits present in the repo and not its parent are shown on the bottom of the column on the right, while we already show in the list of branches which one is in a PR and which one could be. So overall, we can just drop this functionality --- diff --git a/pagure/templates/repo_info.html b/pagure/templates/repo_info.html index af31ad3..338cbc5 100644 --- a/pagure/templates/repo_info.html +++ b/pagure/templates/repo_info.html @@ -257,9 +257,6 @@ git push -u origin master
{{ commit.message.split('\n')[0] }} - {% if diff_commits and commit.oid.hex in diff_commits %} - * - {% endif %}
{% endfor %} diff --git a/pagure/ui/repo.py b/pagure/ui/repo.py index 46f9e3e..2b9d848 100644 --- a/pagure/ui/repo.py +++ b/pagure/ui/repo.py @@ -119,36 +119,6 @@ def view_repo(repo, username=None, namespace=None): 'view_raw_file', username=username, repo=repo_db.name, identifier=branchname, filename='')) - diff_commits = [] - if repo_db.is_fork and repo_db.parent: - parentname = os.path.join( - APP.config['GIT_FOLDER'], repo_db.parent.path) - else: - parentname = os.path.join(APP.config['GIT_FOLDER'], repo_db.path) - - orig_repo = pygit2.Repository(parentname) - - if not repo_obj.is_empty and not orig_repo.is_empty: - - orig_branch = orig_repo.lookup_branch('master') - branch = repo_obj.lookup_branch('master') - if orig_branch and branch: - - master_commits = [ - commit.oid.hex - for commit in orig_repo.walk( - orig_branch.get_object().hex, - pygit2.GIT_SORT_TIME) - ] - - repo_commit = repo_obj[branch.get_object().hex] - - for commit in repo_obj.walk( - repo_commit.oid.hex, pygit2.GIT_SORT_TIME): - if commit.oid.hex in master_commits: - break - diff_commits.append(commit.oid.hex) - return flask.render_template( 'repo_info.html', select='overview', @@ -161,7 +131,6 @@ def view_repo(repo, username=None, namespace=None): branchname=branchname, last_commits=last_commits, tree=tree, - diff_commits=diff_commits, form=pagure.forms.ConfirmationForm(), )