Changeset - c04d1d9b6193
[Not reviewed]
beta
0 6 0
Marcin Kuzminski - 13 years ago 2013-03-21 23:56:17
marcin@python-works.com
made git refs filter configurable ref issue #797
- default --all was kept and --branches --tags (or even other variations) is possible to use via .ini file
6 files changed with 25 insertions and 3 deletions:
0 comments (0 inline, 0 general)
development.ini
Show inline comments
 
@@ -98,6 +98,10 @@ use_gravatar = true
 
## path to git executable
 
git_path = git
 

	
 
## git rev filter option, --all is the default filter, if you need to
 
## hide all refs in changelog switch this to --branches --tags
 
git_rev_filter=--all
 

	
 
## RSS feed options
 
rss_cut_off_limit = 256000
 
rss_items_per_page = 10
production.ini
Show inline comments
 
@@ -98,6 +98,10 @@ use_gravatar = true
 
## path to git executable
 
git_path = git
 

	
 
## git rev filter option, --all is the default filter, if you need to
 
## hide all refs in changelog switch this to --branches --tags
 
git_rev_filter=--all
 

	
 
## RSS feed options
 
rss_cut_off_limit = 256000
 
rss_items_per_page = 10
rhodecode/config/deployment.ini_tmpl
Show inline comments
 
@@ -98,6 +98,10 @@ use_gravatar = true
 
## path to git executable
 
git_path = git
 

	
 
## git rev filter option, --all is the default filter, if you need to
 
## hide all refs in changelog switch this to --branches --tags
 
git_rev_filter=--all
 

	
 
## RSS feed options
 
rss_cut_off_limit = 256000
 
rss_items_per_page = 10
rhodecode/lib/vcs/backends/git/changeset.py
Show inline comments
 
@@ -187,8 +187,10 @@ class GitChangeset(BaseChangeset):
 
        """
 
        Returns list of children changesets.
 
        """
 
        rev_filter = _git_path = rhodecode.CONFIG.get('git_rev_filter',
 
                                              '--all').strip()
 
        so, se = self.repository.run_git_command(
 
            "rev-list --all --children | grep '^%s'" % self.raw_id
 
            "rev-list %s --children | grep '^%s'" % (rev_filter, self.raw_id)
 
        )
 

	
 
        children = []
rhodecode/lib/vcs/backends/git/repository.py
Show inline comments
 
@@ -231,7 +231,9 @@ class GitRepository(BaseRepository):
 
            self._repo.head()
 
        except KeyError:
 
            return []
 
        cmd = 'rev-list --all --reverse --date-order'
 
        rev_filter = _git_path = rhodecode.CONFIG.get('git_rev_filter',
 
                                                      '--all').strip()
 
        cmd = 'rev-list %s --reverse --date-order' % (rev_filter)
 
        try:
 
            so, se = self.run_git_command(cmd)
 
        except RepositoryError:
 
@@ -505,7 +507,9 @@ class GitRepository(BaseRepository):
 
            cmd_template += ' $branch_name'
 
            cmd_params['branch_name'] = branch_name
 
        else:
 
            cmd_template += ' --all'
 
            rev_filter = _git_path = rhodecode.CONFIG.get('git_rev_filter',
 
                                                          '--all').strip()
 
            cmd_template += ' %s' % (rev_filter)
 

	
 
        cmd = Template(cmd_template).safe_substitute(**cmd_params)
 
        revs = self.run_git_command(cmd)[0].splitlines()
test.ini
Show inline comments
 
@@ -98,6 +98,10 @@ use_gravatar = true
 
## path to git executable
 
git_path = git
 

	
 
## git rev filter option, --all is the default filter, if you need to
 
## hide all refs in changelog switch this to --branches --tags
 
git_rev_filter=--all
 

	
 
## RSS feed options
 
rss_cut_off_limit = 256000
 
rss_items_per_page = 10
0 comments (0 inline, 0 general)