Mercurial > hg
view hgweb.cgi @ 8599:1f706b1b62f3
inotify: server: refactor updatestatus()
* Instead of one entry point, use two entry points, updatefile()
and deletefile(), both internally calling the helper function _updatestatus
* Do not rely on TypeError to detect the type of oldstatus: use isinstance
* The call updatestatus(wpath, None) in deleted() was a bit particular:
because no osstat and no newstatus was given, the newstatus was determined
using the data stored internally. To replace this exact behavior with the
new code, one would use:
root, fn = self.split(wpath)
d = self.dir(self.tree, root)
self.filedeleted(wpath, d.get(fn))
This, however, duplicates code with _updatestatus(), which led us to an
interesting question: why are we basing ourselves on repowatcher data to
update the status, where everywhere else, we are comparing against dirsate?
There is no reason to do this, which is why the new code is:
self.filedeleted(wpath, self.repo.dirstate[wpath])
Incidentally, after this, the test for issue1371 passes again.
author | Nicolas Dumazet <nicdumz.commits@gmail.com> |
---|---|
date | Sun, 24 May 2009 18:43:05 +0900 |
parents | 50a277e6ceae |
children | 338167735124 |
line wrap: on
line source
#!/usr/bin/env python # # An example CGI script to use hgweb, edit as necessary # adjust python path if not a system-wide install: #import sys #sys.path.insert(0, "/path/to/python/lib") # enable importing on demand to reduce startup time from mercurial import demandimport; demandimport.enable() # Uncomment to send python tracebacks to the browser if an error occurs: #import cgitb #cgitb.enable() # If you'd like to serve pages with UTF-8 instead of your default # locale charset, you can do so by uncommenting the following lines. # Note that this will cause your .hgrc files to be interpreted in # UTF-8 and all your repo files to be displayed using UTF-8. # #import os #os.environ["HGENCODING"] = "UTF-8" from mercurial.hgweb.hgweb_mod import hgweb import mercurial.hgweb.wsgicgi as wsgicgi application = hgweb("/path/to/repo", "repository name") wsgicgi.launch(application)