Edgewall Software
Modify

Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#10472 closed defect (duplicate)

TracMercurial (0.12.0.27) conflict (hg 2.0) ?

Reported by: spinor Owned by:
Priority: normal Milestone:
Component: version control Version:
Severity: normal Keywords:
Cc: Branch:
Release Notes:
API Changes:
Internal Changes:

Description (last modified by Remy Blank)

While "tracd" seems to run without error, the website is not functional as soon as "tracext.hg.*" is set to "enabled" in trac.ini.

A typical error: Trac detected an internal error: TypeError: plain() takes exactly 1 argument (2 given)

(The above occurs for most (all?) buttons/links pressed on the website.)

Traceback obtained when pressing the "Login" button:

Python Traceback

Most recent call last: 
File "C:/Python26/lib/site-packages/trac/web/main.py", line 511, in _dispatch_request Code fragment:Line  
506     try: 
507         if not env and env_error: 
508             raise HTTPInternalError(env_error) 
509         try: 
510             dispatcher = RequestDispatcher(env) 
511             dispatcher.dispatch(req) 
512         except RequestDone: 
513             pass 
514         resp = req._response or [] 
515   
516     except HTTPException, e: 
Local variables:Name Value 
dispatcher <trac.web.main.RequestDispatcher object at 0x0196D410> 
e TypeError('plain() takes exactly 1 argument (2 given)',) 
env <trac.env.Environment object at 0x0167C3B0> 
env_error None 
req <Request "GET '/login'"> 
resp [] 
File "C:/Python26/lib/site-packages/trac/web/main.py", line 202, in dispatch Code fragment:Line  
197                         if not req.path_info or req.path_info == '/': 
198                             chosen_handler = self.default_handler 
199                     # pre-process any incoming request, whether a handler 
200                     # was found or not 
201                     chosen_handler = self._pre_process_request(req, 
202                                                             chosen_handler) 
203                 except TracError, e: 
204                     raise HTTPInternalError(e) 
205                 if not chosen_handler: 
206                     if req.path_info.endswith('/'): 
207                         # Strip trailing / and redirect 
Local variables:Name Value 
chosen_handler <trac.web.auth.LoginModule object at 0x0196D3F0> 
chrome <trac.web.chrome.Chrome object at 0x01A52170> 
err (<type 'exceptions.TypeError'>, TypeError('plain() takes exactly 1 ... 
handler <trac.web.auth.LoginModule object at 0x0196D3F0> 
req <Request "GET '/login'"> 
self <trac.web.main.RequestDispatcher object at 0x0196D410> 
File "C:/Python26/lib/site-packages/trac/web/main.py", line 344, in _pre_process_request Code fragment:Line  
339                 req.outcookie['trac_form_token']['secure'] = True 
340             return req.outcookie['trac_form_token'].value 
341   
342     def _pre_process_request(self, req, chosen_handler): 
343         for filter_ in self.filters: 
344             chosen_handler = filter_.pre_process_request(req, chosen_handler) 
345         return chosen_handler 
346   
347     def _post_process_request(self, req, *args): 
348         nbargs = len(args) 
349         resp = args 
Local variables:Name Value 
chosen_handler <trac.web.auth.LoginModule object at 0x0196D3F0> 
filter_ <trac.versioncontrol.api.RepositoryManager object at 0x0197A890> 
req <Request "GET '/login'"> 
self <trac.web.main.RequestDispatcher object at 0x0196D410> 
File "C:/Python26/lib/site-packages/trac/versioncontrol/api.py", line 330, in pre_process_request Code fragment:Line  
325             for reponame in self.repository_sync_per_request: 
326                 start = time.time() 
327                 if is_default(reponame): 
328                     reponame = '' 
329                 try: 
330                     repo = self.get_repository(reponame) 
331                     if repo: 
332                         repo.sync() 
333                 except TracError, e: 
334                     add_warning(req, 
335                         _("Can't synchronize with repository \"%(name)s\" " 
Local variables:Name Value 
Chrome <class 'trac.web.chrome.Chrome'> 
add_warning <function add_warning at 0x016108B0> 
handler <trac.web.auth.LoginModule object at 0x0196D3F0> 
reponame '' 
req <Request "GET '/login'"> 
self <trac.versioncontrol.api.RepositoryManager object at 0x0197A890> 
start 1321610762.622 
File "C:/Python26/lib/site-packages/trac/versioncontrol/api.py", line 526, in get_repository Code fragment:Line  
521             repos = repositories.get(reponame) 
522             if not repos: 
523                 if not os.path.isabs(rdir): 
524                     rdir = os.path.join(self.env.path, rdir) 
525                 connector = self._get_connector(rtype) 
526                 repos = connector.get_repository(rtype, rdir, repoinfo.copy()) 
527                 repositories[reponame] = repos 
528             return repos 
529         finally: 
530             self._lock.release() 
531   
Local variables:Name Value 
connector <tracext.hg.backend.MercurialConnector object at 0x0197A810> 
db <trac.db.pool.PooledConnection object at 0x024E3E18> 
rdir u'C:\\Daten\\ibp\\default' 
repoinfo {'name': '', 'dir': u'C:\\Daten\\ibp\\default', 'id': 1} 
reponame '' 
repos None 
repositories {} 
rtype u'hg' 
self <trac.versioncontrol.api.RepositoryManager object at 0x0197A890> 
tid 952 
File "build/bdist.win32/egg/tracext/hg/backend.py", line 382, in get_repository Code fragment:Line  
377   
378     def get_repository(self, type, dir, params): 
379         """Return a `MercurialRepository`""" 
380         if not self.ui: 
381             self._setup_ui(self.hgrc) 
382         repos = MercurialRepository(dir, params, self.log, self) 
383         repos.version_info = self._version_info 
384         return repos 
385   
386     # IWikiSyntaxProvider methods 
387      
Local variables:Name Value 
dir u'C:\\Daten\\ibp\\default' 
params {'name': '', 'dir': u'C:\\Daten\\ibp\\default', 'id': 1} 
self <tracext.hg.backend.MercurialConnector object at 0x0197A810> 
type u'hg' 
File "build/bdist.win32/egg/tracext/hg/backend.py", line 505, in __init__ Code fragment:Line  
500         str_path = checked_encode(path, fsencoding, os.path.exists) 
501         if str_path is None: 
502             raise TracError(_("Repository path '%(path)s' does not exist.",  
503                               path=path)) 
504         try: 
505             self.repo = hg.repository(ui=self.ui, path=str_path) 
506         except RepoError, e: 
507             version = connector._version 
508             error = exception_to_unicode(e) 
509             log.error("Mercurial %s can't open repository (%s)", version, error) 
510             raise TracError(_("'%(path)s' does not appear to contain a" 
Local variables:Name Value 
connector <tracext.hg.backend.MercurialConnector object at 0x0197A810> 
enc u'utf-8' 
encoding [u'utf-8', 'latin1'] 
fsencoding ['mbcs', u'utf-8', 'latin1'] 
log <logging.Logger instance at 0x0169C0A8> 
params {'name': '', 'dir': u'C:\\Daten\\ibp\\default', 'id': 1} 
path u'C:\\Daten\\ibp\\default' 
self <tracext.hg.backend.MercurialRepository object at 0x01C8EBF0> 
str_path 'C:\\Daten\\ibp\\default' 
to_s <function to_s at 0x00C96370> 
to_u <function to_u at 0x02514EF0> 
File "C:/Python26/lib/site-packages/mercurial/hg.py", line 93, in repository Code fragment:Line  
88             return False 
89     return repo.local() 
90   
91 def repository(ui, path='', create=False): 
92     """return a repository object for the specified path""" 
93     repo = _peerlookup(path).instance(ui, path, create) 
94     ui = getattr(repo, "ui", ui) 
95     for name, module in extensions.extensions(): 
96         hook = getattr(module, 'reposetup', None) 
97         if hook: 
98             hook(ui, repo) 
Local variables:Name Value 
create False 
path 'C:\\Daten\\ibp\\default' 
ui <tracext.hg.backend.trac_ui object at 0x0197A290> 
File "C:/Python26/lib/site-packages/mercurial/localrepo.py", line 2098, in instance Code fragment:Line  
2093     base, name = os.path.split(fn) 
2094     assert name.startswith('journal') 
2095     return os.path.join(base, name.replace('journal', 'undo', 1)) 
2096   
2097 def instance(ui, path, create): 
2098     return localrepository(ui, util.urllocalpath(path), create) 
2099   
2100 def islocal(path): 
2101     return True 
Local variables:Name Value 
create False 
path 'C:\\Daten\\ibp\\default' 
ui <tracext.hg.backend.trac_ui object at 0x0197A290> 
File "C:/Python26/lib/site-packages/mercurial/localrepo.py", line 41, in __init__ Code fragment:Line  
36         self.wopener = scmutil.opener(self.root) 
37         self.baseui = baseui 
38         self.ui = baseui.copy() 
39   
40         try: 
41             self.ui.readconfig(self.join("hgrc"), self.root) 
42             extensions.loadall(self.ui) 
43         except IOError: 
44             pass 
45   
46         if not os.path.isdir(self.path): 
Local variables:Name Value 
baseui <tracext.hg.backend.trac_ui object at 0x0197A290> 
create False 
path 'C:\\Daten\\ibp\\default' 
self <mercurial.localrepo.localrepository object at 0x01A4D470> 
File "C:/Python26/lib/site-packages/mercurial/ui.py", line 96, in readconfig Code fragment:Line  
91                 if k in cfg['ui']: 
92                     del cfg['ui'][k] 
93             for k, v in cfg.items('defaults'): 
94                 del cfg['defaults'][k] 
95         # Don't remove aliases from the configuration if in the exceptionlist 
96         if self.plain('alias'): 
97             for k, v in cfg.items('alias'): 
98                 del cfg['alias'][k] 
99   
100         if trusted: 
101             self._tcfg.update(cfg) 
Local variables:Name Value 
cfg <mercurial.config.config object at 0x01B01F70> 
filename 'C:\\Daten\\ibp\\default\\.hg\\hgrc' 
fp <open file 'C:\Daten\ibp\default\.hg\hgrc', mode 'r' at 0x0160DC28> 
remap None 
root 'C:\\Daten\\ibp\\default' 
sections None 
self <tracext.hg.backend.trac_ui object at 0x01B01AF0> 
trust False 
trusted True 

File "C:/Python26/lib/site-packages/trac/web/main.py", line 511, in _dispatch_request
  dispatcher.dispatch(req)
File "C:/Python26/lib/site-packages/trac/web/main.py", line 202, in dispatch
  chosen_handler)
File "C:/Python26/lib/site-packages/trac/web/main.py", line 344, in _pre_process_request
  chosen_handler = filter_.pre_process_request(req, chosen_handler)
File "C:/Python26/lib/site-packages/trac/versioncontrol/api.py", line 330, in pre_process_request
  repo = self.get_repository(reponame)
File "C:/Python26/lib/site-packages/trac/versioncontrol/api.py", line 526, in get_repository
  repos = connector.get_repository(rtype, rdir, repoinfo.copy())
File "build/bdist.win32/egg/tracext/hg/backend.py", line 382, in get_repository
  repos = MercurialRepository(dir, params, self.log, self)
File "build/bdist.win32/egg/tracext/hg/backend.py", line 505, in __init__
  self.repo = hg.repository(ui=self.ui, path=str_path)
File "C:/Python26/lib/site-packages/mercurial/hg.py", line 93, in repository
  repo = _peerlookup(path).instance(ui, path, create)
File "C:/Python26/lib/site-packages/mercurial/localrepo.py", line 2098, in instance
  return localrepository(ui, util.urllocalpath(path), create)
File "C:/Python26/lib/site-packages/mercurial/localrepo.py", line 41, in __init__
  self.ui.readconfig(self.join("hgrc"), self.root)
File "C:/Python26/lib/site-packages/mercurial/ui.py", line 96, in readconfig
  if self.plain('alias'):


System Information:
User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.2; WOW64; Trident/4.0; .NET CLR 2.0.50727; .NET CLR 1.1.4322; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)

Trac 0.12.2 
Babel 0.9.5 
Docutils 0.7 
Genshi 0.6 
Mercurial 2.0 
Pygments 1.4 
pysqlite 2.4.1 
Python 2.6.5 (r265:79096, Mar 19 2010, 21:48:26) [MSC v.1500 32 bit (Intel)] 
pytz 2010o 
setuptools 0.6c11 
SQLite 3.5.9 
jQuery 1.4.2 

Enabled Plugins:
tracmercurial  0.12.0.27 c:\python26\lib\site-packages\tracmercurial-0.12.0.27-py2.6.egg 

Attachments (0)

Change History (4)

comment:1 by Remy Blank, 12 years ago

Component: generalversion control
Description: modified (diff)
Resolution: duplicate
Status: newclosed

Looking at the traceback, this really is a duplicate of #10336, and was fixed in [10698], but we haven't made a release of the plugin since then (0.12.0.27 is at [10620]). In the meantime, please install the plugin from SVN directly.

comment:2 by anonymous, 12 years ago

This seems to work, thank you.

comment:3 by Christian Boos, 12 years ago

Remy, by release you mean removing the 'dev' tag_build? If so, feel free to do it. The plugin seems to work fine with 2.0 (I haven't tested with more recent versions but Mercurial:ApiChanges doesn't mention anything new).

comment:4 by Remy Blank, 12 years ago

Done, see TracMercurial@88.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The ticket will remain with no owner.
The resolution will be deleted. Next status will be 'reopened'.
to The owner will be changed from (none) to the specified user.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.