Commits

mdelagra committed 8f92c64 Merge

merged in changes from parent project (see CHANGELOG)

Comments (0)

Files changed (4)

+Version 3.3.0 (7/16/10)
+
+    * fixed import issue for windows
+
+    some windows distributions don't include the "webbrowser" module
+
+    * merged in latest changes from parent project
+
+    changes included below
+    
+    * Mercurial 1.6 compatibility (also works with 1.4 and 1.5)
+    
+    * improved Windows compatibility
+    
+    * added support for HTTP Digest Auth
+
 Version 3.2.1 (5/18/10)
 
     * fixed bug using --branch flag
File contents unchanged.

mercurial_reviewboard/__init__.py

 def remoteparent(ui, repo, ctx, upstream=None):
     remotepath = expandpath(ui, upstream)
     remoterepo = hg.repository(ui, remotepath)
-    out = repo.findoutgoing(remoterepo)
+    
+    try:
+        from mercurial import discovery
+        out = discovery.findoutgoing(repo, remoterepo)
+    except ImportError:
+        # python <2.6 compatibility
+        out = repo.findoutgoing(remoterepo)
+    
     for o in out:
         orev = repo[o]
         a, b, c = repo.changelog.nodesbetween([orev.node()], [ctx.node()])

mercurial_reviewboard/reviewboard.py

 import os
 import urllib2
 import simplejson
+import mercurial.ui
 from urlparse import urljoin, urlparse
 
 class APIError(Exception):
                 print "==> HTTP Authentication Required"
                 print 'Enter username and password for "%s" at %s' % \
                     (realm, urlparse(uri)[1])
-                self.rb_user = raw_input('Username: ')
+                self.rb_user = mercurial.ui.ui().prompt('Username: ')
                 self.rb_pass = getpass.getpass('Password: ')
 
             return self.rb_user, self.rb_pass
         if not url.endswith('/'):
             url = url + '/'
         self.url       = url
-        if 'USERPROFILE' in os.environ:
+        if 'APPDATA' in os.environ:
+            homepath = os.environ["APPDATA"]
+        elif 'USERPROFILE' in os.environ:
             homepath = os.path.join(os.environ["USERPROFILE"], "Local Settings",
                                     "Application Data")
         elif 'HOME' in os.environ:
                         urllib2.HTTPDefaultErrorHandler(),
                         urllib2.HTTPErrorProcessor(),
                         urllib2.HTTPCookieProcessor(self._cj),
-                        urllib2.HTTPBasicAuthHandler(password_mgr)
+                        urllib2.HTTPBasicAuthHandler(password_mgr),
+                        urllib2.HTTPDigestAuthHandler(password_mgr)
                         )
         urllib2.install_opener(self._opener)
         self._repositories = None
             return
 
         if not username:
-            username = raw_input('Username: ')
+            username = mercurial.ui.ui().prompt('Username: ')
         if not password:
             password = getpass.getpass('Password: ')