300: hg scm backend does not work with http repositories

mswi****@gmai***** (Google Code) (Is this you? Claim this profile.)
Nov. 30, 2007
The mercurial backend does not work with remote (http) repositories.  This
is because a httprepos object does not have a changectx() method.  There is
a much easier method for implementing cat_file() if a http repository is used.

Additionally, get_diffs_use_absolute_paths() should return True for the
HgTool backend.  If it returns False, the basedir input field does not
show, but it is a required field.  This causes the diff_form to not have a
cleaned_data dictionary after diff_form.full_clean() is called.  See
http://groups.google.com/group/reviewboard/browse_thread/thread/4e7e4d4b60e1bfb2/77432b59da5d7872?#77432b59da5d7872
Index: scmtools/core.py
===================================================================
--- scmtools/core.py	(revision 1030)
+++ scmtools/core.py	(working copy)
@@ -24,6 +24,8 @@
         else:
             msg = "The file '%s' (r%s) could not be found in the repository" \
                 % (path, revision)
+        if detail:
+            msg += ': ' + detail
         Exception.__init__(self, msg)
 
         self.revision = revision
Index: scmtools/hg.py
===================================================================
--- scmtools/hg.py	(revision 1030)
+++ scmtools/hg.py	(working copy)
@@ -1,3 +1,5 @@
+import urllib2
+
 from reviewboard.diffviewer.parser import DiffParser, DiffParserError
 from reviewboard.scmtools.core import \
     FileNotFoundError, SCMTool, HEAD, PRE_CREATION
@@ -5,7 +7,10 @@
 class HgTool(SCMTool):
     def __init__(self, repository):
         SCMTool.__init__(self, repository)
-        self.client = HgClient(repository.path)
+        if repository.path.s
david
#1 david
Fixed in SVN.  Thanks!
  • +Fixed
  • +Component-SCMTools