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
 
@@ -95,12 +95,16 @@ dashboard_items = 100
 
## use gravatar service to display avatars
 
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
 
rss_include_diff = false
 

	
 
## show hash options for changelog
production.ini
Show inline comments
 
@@ -95,12 +95,16 @@ dashboard_items = 100
 
## use gravatar service to display avatars
 
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
 
rss_include_diff = false
 

	
 
## show hash options for changelog
rhodecode/config/deployment.ini_tmpl
Show inline comments
 
@@ -95,12 +95,16 @@ dashboard_items = 100
 
## use gravatar service to display avatars
 
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
 
rss_include_diff = false
 

	
 
## show hash options for changelog
rhodecode/lib/vcs/backends/git/changeset.py
Show inline comments
 
@@ -184,14 +184,16 @@ class GitChangeset(BaseChangeset):
 

	
 
    @LazyProperty
 
    def children(self):
 
        """
 
        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 = []
 
        for l in so.splitlines():
 
            childs = l.split(' ')[1:]
 
            children.extend(childs)
rhodecode/lib/vcs/backends/git/repository.py
Show inline comments
 
@@ -228,13 +228,15 @@ class GitRepository(BaseRepository):
 
        # fails if it is. And it's cheaper to ask than throw the subprocess
 
        # errors
 
        try:
 
            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:
 
            # Can be raised for empty repositories
 
            return []
 
        return so.splitlines()
 
@@ -502,13 +504,15 @@ class GitRepository(BaseRepository):
 
            cmd_template += ' --until "$until"'
 
            cmd_params['until'] = end_date.strftime('%m/%d/%y %H:%M:%S')
 
        if branch_name:
 
            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()
 
        start_pos = 0
 
        end_pos = len(revs)
 
        if start:
test.ini
Show inline comments
 
@@ -95,12 +95,16 @@ dashboard_items = 100
 
## use gravatar service to display avatars
 
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
 
rss_include_diff = false
 

	
 
## show hash options for changelog
0 comments (0 inline, 0 general)