Mercurial > kallithea
comparison rhodecode/controllers/compare.py @ 3783:f533c054fb19 beta
It's better to use Exception here than assertion. It plays better with the exception handling software like sentry or errormator
author | Marcin Kuzminski <marcin@python-works.com> |
---|---|
date | Mon, 22 Apr 2013 15:49:59 +0200 |
parents | d23f2bea2346 |
children | 3591b33e0c94 |
comparison
equal
deleted
inserted
replaced
3782:c7c4855517c4 | 3783:f533c054fb19 |
---|---|
143 | 143 |
144 changesets = [other_repo.get_changeset(cs) | 144 changesets = [other_repo.get_changeset(cs) |
145 for cs in scmutil.revrange(hgrepo, revs)] | 145 for cs in scmutil.revrange(hgrepo, revs)] |
146 | 146 |
147 elif alias == 'git': | 147 elif alias == 'git': |
148 assert org_repo == other_repo, ('no support for compare for two ' | 148 if org_repo != other_repo: |
149 'different repositories in git') | 149 raise Exception('Comparing of different GIT repositories is not' |
150 'allowed. Got %s != %s' % (org_repo, other_repo)) | |
151 | |
150 so, se = org_repo.run_git_command( | 152 so, se = org_repo.run_git_command( |
151 'log --reverse --pretty="format: %%H" -s -p %s..%s' | 153 'log --reverse --pretty="format: %%H" -s -p %s..%s' |
152 % (org_ref[1], other_ref[1]) | 154 % (org_ref[1], other_ref[1]) |
153 ) | 155 ) |
154 changesets = [org_repo.get_changeset(cs) | 156 changesets = [org_repo.get_changeset(cs) |