Mercurial > hg
comparison mercurial/hgweb/hgweb_mod.py @ 22223:c39d404f0eb0
hgweb: refresh repository using URL not path (issue4323)
hgweb detects out-of-date repository instances (using a highly
suspect mechanism that should probably be fixed) and obtains a new
repository object if needed.
This patch changes the repository object copy to use the repo URL
(instead of path). This preserves more information about the source
repository and allows bundles to be served through hgweb.
A test verifying that bundles can now be served properly via
`hg serve` has been added.
author | Gregory Szorc <gregory.szorc@gmail.com> |
---|---|
date | Mon, 18 Aug 2014 12:12:57 -0700 |
parents | b27c3beaaf30 |
children | 4109cc16279e |
comparison
equal
deleted
inserted
replaced
22222:883e8b6bd461 | 22223:c39d404f0eb0 |
---|---|
108 def refresh(self, request=None): | 108 def refresh(self, request=None): |
109 st = get_stat(self.repo.spath) | 109 st = get_stat(self.repo.spath) |
110 # compare changelog size in addition to mtime to catch | 110 # compare changelog size in addition to mtime to catch |
111 # rollbacks made less than a second ago | 111 # rollbacks made less than a second ago |
112 if st.st_mtime != self.mtime or st.st_size != self.size: | 112 if st.st_mtime != self.mtime or st.st_size != self.size: |
113 r = hg.repository(self.repo.baseui, self.repo.root) | 113 r = hg.repository(self.repo.baseui, self.repo.url()) |
114 self.repo = self._getview(r) | 114 self.repo = self._getview(r) |
115 self.maxchanges = int(self.config("web", "maxchanges", 10)) | 115 self.maxchanges = int(self.config("web", "maxchanges", 10)) |
116 self.stripecount = int(self.config("web", "stripes", 1)) | 116 self.stripecount = int(self.config("web", "stripes", 1)) |
117 self.maxshortchanges = int(self.config("web", "maxshortchanges", | 117 self.maxshortchanges = int(self.config("web", "maxshortchanges", |
118 60)) | 118 60)) |