Show More
@@ -90,5 +90,17 b" def make_ui(path='hgwebdir.config', chec" | |||
|
90 | 90 | |
|
91 | 91 | return baseui |
|
92 | 92 | |
|
93 | from vcs.backends.base import BaseChangeset | |
|
94 | from vcs.utils.lazy import LazyProperty | |
|
95 | class EmptyChangeset(BaseChangeset): | |
|
93 | 96 | |
|
97 | revision = -1 | |
|
94 | 98 | |
|
99 | @LazyProperty | |
|
100 | def raw_id(self): | |
|
101 | """ | |
|
102 | Returns raw string identifing this changeset, useful for web | |
|
103 | representation. | |
|
104 | """ | |
|
105 | return '0' * 12 | |
|
106 |
@@ -3,6 +3,7 b'' | |||
|
3 | 3 | # |
|
4 | 4 | # Copyright (c) 2010 marcink. All rights reserved. |
|
5 | 5 | # |
|
6 | from vcs.exceptions import RepositoryError | |
|
6 | 7 | ''' |
|
7 | 8 | Created on Apr 9, 2010 |
|
8 | 9 | |
@@ -37,8 +38,12 b' class HgModel(object):' | |||
|
37 | 38 | continue |
|
38 | 39 | |
|
39 | 40 | last_change = mercurial_repo.last_change |
|
40 | tip_rev = mercurial_repo._get_revision('tip') | |
|
41 |
tip = mercurial_repo.get_changeset( |
|
|
41 | try: | |
|
42 | tip = mercurial_repo.get_changeset('tip') | |
|
43 | except RepositoryError: | |
|
44 | from pylons_app.lib.utils import EmptyChangeset | |
|
45 | tip = EmptyChangeset() | |
|
46 | ||
|
42 | 47 | tmp_d = {} |
|
43 | 48 | tmp_d['name'] = mercurial_repo.name |
|
44 | 49 | tmp_d['name_sort'] = tmp_d['name'] |
@@ -46,9 +51,9 b' class HgModel(object):' | |||
|
46 | 51 | tmp_d['description_sort'] = tmp_d['description'] |
|
47 | 52 | tmp_d['last_change'] = last_change |
|
48 | 53 | tmp_d['last_change_sort'] = last_change[1] - last_change[0] |
|
49 |
tmp_d['tip'] = tip. |
|
|
50 |
tmp_d['tip_sort'] = tip |
|
|
51 |
tmp_d['rev'] = tip |
|
|
54 | tmp_d['tip'] = tip.raw_id | |
|
55 | tmp_d['tip_sort'] = tip.revision | |
|
56 | tmp_d['rev'] = tip.revision | |
|
52 | 57 | tmp_d['contact'] = mercurial_repo.contact |
|
53 | 58 | tmp_d['contact_sort'] = tmp_d['contact'] |
|
54 | 59 | tmp_d['repo_archives'] = list(mercurial_repo._get_archives()) |
General Comments 0
You need to be logged in to leave comments.
Login now