Show More
@@ -97,12 +97,13 b' class ReposController(BaseController):' | |||
|
97 | 97 | .filter(UserFollowing.follows_repository == c.repo_info).scalar() |
|
98 | 98 | |
|
99 | 99 | if c.repo_info.stats: |
|
100 | last_rev = c.repo_info.stats.stat_on_revision | |
|
100 | # this is on what revision we ended up so we add +1 for count | |
|
101 | last_rev = c.repo_info.stats.stat_on_revision + 1 | |
|
101 | 102 | else: |
|
102 | 103 | last_rev = 0 |
|
103 | 104 | c.stats_revision = last_rev |
|
104 | 105 | |
|
105 |
c.repo_last_rev = repo.count() |
|
|
106 | c.repo_last_rev = repo.count() if repo.revisions else 0 | |
|
106 | 107 | |
|
107 | 108 | if last_rev == 0 or c.repo_last_rev == 0: |
|
108 | 109 | c.stats_percentage = 0 |
@@ -287,6 +288,7 b' class ReposController(BaseController):' | |||
|
287 | 288 | try: |
|
288 | 289 | repo_model = RepoModel() |
|
289 | 290 | repo_model.delete_perm_user(request.POST, repo_name) |
|
291 | Session.commit() | |
|
290 | 292 | except Exception, e: |
|
291 | 293 | h.flash(_('An error occurred during deletion of repository user'), |
|
292 | 294 | category='error') |
@@ -302,6 +304,7 b' class ReposController(BaseController):' | |||
|
302 | 304 | try: |
|
303 | 305 | repo_model = RepoModel() |
|
304 | 306 | repo_model.delete_perm_users_group(request.POST, repo_name) |
|
307 | Session.commit() | |
|
305 | 308 | except Exception, e: |
|
306 | 309 | h.flash(_('An error occurred during deletion of repository' |
|
307 | 310 | ' users groups'), |
@@ -319,6 +322,7 b' class ReposController(BaseController):' | |||
|
319 | 322 | try: |
|
320 | 323 | repo_model = RepoModel() |
|
321 | 324 | repo_model.delete_stats(repo_name) |
|
325 | Session.commit() | |
|
322 | 326 | except Exception, e: |
|
323 | 327 | h.flash(_('An error occurred during deletion of repository stats'), |
|
324 | 328 | category='error') |
@@ -334,6 +338,7 b' class ReposController(BaseController):' | |||
|
334 | 338 | |
|
335 | 339 | try: |
|
336 | 340 | ScmModel().mark_for_invalidation(repo_name) |
|
341 | Session.commit() | |
|
337 | 342 | except Exception, e: |
|
338 | 343 | h.flash(_('An error occurred during cache invalidation'), |
|
339 | 344 | category='error') |
@@ -357,6 +362,7 b' class ReposController(BaseController):' | |||
|
357 | 362 | self.scm_model.toggle_following_repo(repo_id, user_id) |
|
358 | 363 | h.flash(_('Updated repository visibility in public journal'), |
|
359 | 364 | category='success') |
|
365 | Session.commit() | |
|
360 | 366 | except: |
|
361 | 367 | h.flash(_('An error occurred during setting this' |
|
362 | 368 | ' repository in public journal'), |
@@ -80,12 +80,12 b' class ForksController(BaseRepoController' | |||
|
80 | 80 | .filter(UserFollowing.follows_repository == c.repo_info).scalar() |
|
81 | 81 | |
|
82 | 82 | if c.repo_info.stats: |
|
83 | last_rev = c.repo_info.stats.stat_on_revision | |
|
83 | last_rev = c.repo_info.stats.stat_on_revision+1 | |
|
84 | 84 | else: |
|
85 | 85 | last_rev = 0 |
|
86 | 86 | c.stats_revision = last_rev |
|
87 | 87 | |
|
88 |
c.repo_last_rev = repo.count() |
|
|
88 | c.repo_last_rev = repo.count() if repo.revisions else 0 | |
|
89 | 89 | |
|
90 | 90 | if last_rev == 0 or c.repo_last_rev == 0: |
|
91 | 91 | c.stats_percentage = 0 |
@@ -57,6 +57,7 b" README_FILES = [''.join([x[0][0], x[1][0" | |||
|
57 | 57 | sorted(list(product(ALL_READMES, ALL_EXTS)), |
|
58 | 58 | key=lambda y:y[0][1] + y[1][1])] |
|
59 | 59 | |
|
60 | ||
|
60 | 61 | class SummaryController(BaseRepoController): |
|
61 | 62 | |
|
62 | 63 | @LoginRequired() |
@@ -94,7 +95,7 b' class SummaryController(BaseRepoControll' | |||
|
94 | 95 | uri = uri_tmpl % {'user': username, |
|
95 | 96 | 'pass': password, |
|
96 | 97 | 'scheme': parsed_url.scheme, |
|
97 | 'netloc':parsed_url.netloc, | |
|
98 | 'netloc': parsed_url.netloc, | |
|
98 | 99 | 'path':parsed_url.path} |
|
99 | 100 | |
|
100 | 101 | c.clone_repo_url = uri |
@@ -151,8 +152,8 b' class SummaryController(BaseRepoControll' | |||
|
151 | 152 | key=lambda k: k[1])[:10] |
|
152 | 153 | ) |
|
153 | 154 | ) |
|
154 | last_rev = stats.stat_on_revision | |
|
155 |
c.repo_last_rev = c.rhodecode_repo.count() |
|
|
155 | last_rev = stats.stat_on_revision + 1 | |
|
156 | c.repo_last_rev = c.rhodecode_repo.count()\ | |
|
156 | 157 | if c.rhodecode_repo.revisions else 0 |
|
157 | 158 | if last_rev == 0 or c.repo_last_rev == 0: |
|
158 | 159 | pass |
@@ -78,12 +78,13 b' def get_logger(cls):' | |||
|
78 | 78 | |
|
79 | 79 | return log |
|
80 | 80 | |
|
81 | ||
|
81 | 82 | @task(ignore_result=True) |
|
82 | 83 | @locked_task |
|
83 | 84 | def whoosh_index(repo_location, full_index): |
|
84 | 85 | from rhodecode.lib.indexers.daemon import WhooshIndexingDaemon |
|
85 | 86 | |
|
86 | #log = whoosh_index.get_logger() | |
|
87 | # log = whoosh_index.get_logger(whoosh_index) | |
|
87 | 88 | |
|
88 | 89 | index_location = config['index_dir'] |
|
89 | 90 | WhooshIndexingDaemon(index_location=index_location, |
@@ -100,6 +101,7 b' def get_commits_stats(repo_name, ts_min_' | |||
|
100 | 101 | lockkey_path = config['here'] |
|
101 | 102 | |
|
102 | 103 | log.info('running task with lockkey %s', lockkey) |
|
104 | ||
|
103 | 105 | try: |
|
104 | 106 | sa = get_session() |
|
105 | 107 | lock = l = DaemonLock(file_=jn(lockkey_path, lockkey)) |
@@ -114,15 +116,15 b' def get_commits_stats(repo_name, ts_min_' | |||
|
114 | 116 | return True |
|
115 | 117 | |
|
116 | 118 | repo = repo.scm_instance |
|
117 |
repo_size = |
|
|
118 | #return if repo have no revisions | |
|
119 | repo_size = repo.count() | |
|
120 | # return if repo have no revisions | |
|
119 | 121 | if repo_size < 1: |
|
120 | 122 | lock.release() |
|
121 | 123 | return True |
|
122 | 124 | |
|
123 | 125 | skip_date_limit = True |
|
124 | 126 | parse_limit = int(config['app_conf'].get('commit_parse_limit')) |
|
125 |
last_rev = |
|
|
127 | last_rev = None | |
|
126 | 128 | last_cs = None |
|
127 | 129 | timegetter = itemgetter('time') |
|
128 | 130 | |
@@ -149,8 +151,10 b' def get_commits_stats(repo_name, ts_min_' | |||
|
149 | 151 | log.debug('starting parsing %s', parse_limit) |
|
150 | 152 | lmktime = mktime |
|
151 | 153 | |
|
152 |
last_rev = last_rev + 1 if last_rev > 0 else |
|
|
153 | ||
|
154 | last_rev = last_rev + 1 if last_rev >= 0 else 0 | |
|
155 | log.debug('Getting revisions from %s to %s' % ( | |
|
156 | last_rev, last_rev + parse_limit) | |
|
157 | ) | |
|
154 | 158 | for cs in repo[last_rev:last_rev + parse_limit]: |
|
155 | 159 | last_cs = cs # remember last parsed changeset |
|
156 | 160 | k = lmktime([cs.date.timetuple()[0], cs.date.timetuple()[1], |
General Comments 0
You need to be logged in to leave comments.
Login now