Skip to content
Snippets Groups Projects
  1. Dec 14, 2013
  2. Nov 25, 2013
    • Stéphane Klein's avatar
      http: reuse authentication info after the first failed request (issue3567) · 18110872
      Stéphane Klein authored
      Context: mercurial access to repository server with http access, and this
      server is protected by basic auth.
      
      Before patch:
      
      * mercurial try an anonymous access to server, server return 401 response and
        mercurial resend request with login / password information
      
      After patch:
      
      * mercurial try an anonymous access to server, server return 401
        response. For all subsequent requests, mercurial keep in memory this
        information (this server need basic auth information).
      
      This patch reduce the number of http access against mercurial server.
      
      Example, before patch :
      
      10.10.168.170 - - [25/Oct/2013:15:44:51 +0200] "GET /hg/testagt?cmd=capabilities
      HTTP/1.1" 401 260 "-" "mercurial/proto-1.0"
      10.10.168.170 - - [25/Oct/2013:15:44:52 +0200] "GET /hg/testagt?cmd=capabilities
      HTTP/1.1" 200 147 "-" "mercurial/proto-1.0"
      10.10.168.170 - - [25/Oct/2013:15:45:00 +0200] "GET /hg/testagt?cmd=capabilities
      HTTP/1.1" 401 260 "-" "mercurial/proto-1.0"
      10.10.168.170 - - [25/Oct/2013:15:45:01 +0200] "GET /hg/testagt?cmd=capabilities
      HTTP/1.1" 200 147 "-" "mercurial/proto-1.0"
      10.10.168.170 - - [25/Oct/2013:15:45:03 +0200] "GET /hg/testagt?cmd=batch
      HTTP/1.1" 401 260 "-" "mercurial/proto-1.0"
      10.10.168.170 - - [25/Oct/2013:15:45:04 +0200] "GET /hg/testagt?cmd=batch
      HTTP/1.1" 200 42 "-" "mercurial/proto-1.0"
      10.10.168.170 - - [25/Oct/2013:15:45:06 +0200] "GET /hg/testagt?cmd=getbundle
      HTTP/1.1" 401 260 "-" "mercurial/proto-1.0"
      10.10.168.170 - - [25/Oct/2013:15:45:07 +0200] "GET /hg/testagt?cmd=getbundle
      HTTP/1.1" 200 61184 "-" "mercurial/proto-1.0"
      10.10.168.170 - - [25/Oct/2013:15:45:09 +0200] "GET /hg/testagt?cmd=listkeys
      HTTP/1.1" 401 260 "-" "mercurial/proto-1.0"
      10.10.168.170 - - [25/Oct/2013:15:45:10 +0200] "GET /hg/testagt?cmd=listkeys
      HTTP/1.1" 200 15 "-" "mercurial/proto-1.0"
      10.10.168.170 - - [25/Oct/2013:15:45:12 +0200] "GET /hg/testagt?cmd=listkeys
      HTTP/1.1" 401 260 "-" "mercurial/proto-1.0"
      10.10.168.170 - - [25/Oct/2013:15:45:12 +0200] "GET /hg/testagt?cmd=listkeys
      HTTP/1.1" 200 - "-" "mercurial/proto-1.0"
      
      Example after patch :
      
      10.10.168.170 - - [28/Oct/2013:11:49:14 +0100] "GET /hg/testagt?cmd=capabilities
      HTTP/1.1" 401 260 "-" "mercurial/proto-1.0"
      10.10.168.170 - - [28/Oct/2013:11:49:15 +0100] "GET /hg/testagt?cmd=capabilities
      HTTP/1.1" 200 147 "-" "mercurial/proto-1.0"
      10.10.168.170 - - [28/Oct/2013:11:49:17 +0100] "GET /hg/testagt?cmd=batch
      HTTP/1.1" 200 42 "-" "mercurial/proto-1.0"
      10.10.168.170 - - [28/Oct/2013:11:49:19 +0100] "GET /hg/testagt?cmd=getbundle
      HTTP/1.1" 200 61184 "-" "mercurial/proto-1.0"
      10.10.168.170 - - [28/Oct/2013:11:49:22 +0100] "GET /hg/testagt?cmd=listkeys
      HTTP/1.1" 200 15 "-" "mercurial/proto-1.0"
      10.10.168.170 - - [28/Oct/2013:11:49:24 +0100] "GET /hg/testagt?cmd=listkeys
      HTTP/1.1" 200 - "-" "mercurial/proto-1.0"
      
      In this last example, you can see only one 401 response.
      18110872
  3. Dec 12, 2013
  4. Dec 11, 2013
  5. Dec 02, 2013
  6. Dec 01, 2013
  7. Nov 29, 2013
    • Chris Jerdonek's avatar
      parsers: fail fast if Python has wrong minor version (issue4110) · 21dafd85
      Chris Jerdonek authored
      This change causes an informative ImportError to be raised when importing
      the extension module parsers if the minor version of the currently-running
      Python interpreter doesn't match that of the Python that was used when
      compiling the extension module.  Here is an example of what the new error
      looks like:
      
        Traceback (most recent call last):
          File "test.py", line 1, in <module>
            import mercurial.parsers
        ImportError: Python minor version mismatch: The Mercurial extension
        modules were compiled with Python 2.7.6, but Mercurial is currently using
        Python with sys.hexversion=33883888: Python 2.5.6
        (r256:88840, Nov 18 2012, 05:37:10)
        [GCC 4.2.1 Compatible Apple Clang 4.1 ((tags/Apple/clang-421.11.66))]
         at: /opt/local/Library/Frameworks/Python.framework/Versions/2.5/Resources/
          Python.app/Contents/MacOS/Python
      
      The reason for raising an error in this scenario is that Python's C API
      is known not to be compatible from minor version to minor version, even
      if sys.api_version is the same.  See for example this Python bug report
      about incompatibilities between 2.5 and 2.6+:
      
        http://bugs.python.org/issue8118
      
      These incompatibilities can cause Mercurial to break in mysterious,
      unforeseen ways.  For example, when Mercurial compiled with Python 2.7 was
      run with 2.5, the following crash occurred when running "hg status":
      
        http://bz.selenic.com/show_bug.cgi?id=4110
      
      After this crash was fixed, running with Python 2.5 no longer crashes, but
      the following puzzling behavior still occurs:
      
          $ hg status
            ...
            File ".../mercurial/changelog.py", line 123, in __init__
              revlog.revlog.__init__(self, opener, "00changelog.i")
            File ".../mercurial/revlog.py", line 251, in __init__
              d = self._io.parseindex(i, self._inline)
            File ".../mercurial/revlog.py", line 158, in parseindex
              index, cache = parsers.parse_index2(data, inline)
          TypeError: data is not a string
      
      which can be reproduced more simply with:
      
          import mercurial.parsers as parsers
          parsers.parse_index2("", True)
      
      Both the crash and the TypeError occurred because the Python C API's
      PyString_Check returns the wrong value when the C header files from
      Python 2.7 are run with Python 2.5.  This is an example of an
      incompatibility of the sort mentioned in the Python bug report above.
      
      Failing fast with an informative error message will result in a better
      user experience in cases like the above.  The information in the ImportError
      will also simplify troubleshooting for those on Mercurial mailing lists,
      the bug tracker, etc.
      
      This patch only adds the version check to parsers.c, which is sufficient
      to affect command-line commands like "hg status" and "hg summary".
      An idea for a future improvement is to move the version-checking C code
      to a more central location, and have it run when importing all
      Mercurial extension modules and not just parsers.c.
      21dafd85
  8. Dec 01, 2013
    • Andrej Shadura's avatar
      hgk: fix tag list parser (issue4101) · 970394b6
      Andrej Shadura authored
      As tags may have embedded spaces, and "hg tags" command doesn't escape them,
      the output of the command doesn't make a well-formed list, so we can't just
      iterate over it. Instead, apply a simple regexp to transform it to a list
      which we actually use. Line boundary matching should be enabled.
      970394b6
    • Matt Mackall's avatar
      merge with i18n · 35bfe540
      Matt Mackall authored
      35bfe540
  9. Nov 27, 2013
    • Katsunori FUJIWARA's avatar
      i18n: add the tool to check Mercurial specific translation problems in *.po · 84939b72
      Katsunori FUJIWARA authored
      Existing tool like "msgfmt --check" can check typical translation
      problems (missing "%s" in msgstr, for example), but can't check
      Mercurial specific ones.
      
      For example, "msgfmt --check" can't check whether the translated
      string given to "ui.promptchoice()" is correct or not, even though
      problems like below cause run-time error or unexpected behavior:
      
        - less or more choices than msgid,
        - choices without '&', or
        - choices with '&' followed by none
      
      This patch adds the tool to check Mercurial specific translation
      problems in *.po files.
      84939b72
    • Santiago Pay=C3=A0 i Miralta's avatar
    • Durham Goode's avatar
      unshelve: add tests for unknown files · 11dbc38c
      Durham Goode authored
      Adds a basic test for shelving/unshelving with an unknown file present.
      
      Adds a test for unshelving on top of an existing unknown file.
      11dbc38c
    • Durham Goode's avatar
      unshelve: don't commit unknown files during unshelve (issue4113) · 578b888c
      Durham Goode authored
      Previously, unshelve would temporarily commit unknown files (via addremove) in
      an attempt to allow unshelving into unknown files.  This produced unexpected
      results, like the file time stamp changing and a .i file being created.
      
      This change makes it no longer use addremove.  It ignores unknown files
      completely.  If an unshelve would overwrite an unknown file, the unknown file is
      moved to *.orig
      
      The shelve continue/abort format is changed, but it just removes stuff from the
      end of the file, so it can still read the old format.
      578b888c
  10. Nov 26, 2013
  11. Nov 22, 2013
  12. Nov 30, 2013
  13. Nov 28, 2013
  14. Nov 26, 2013
  15. Nov 27, 2013
  16. Nov 25, 2013
    • Sean Farley's avatar
      pathcomplete: remove ambiguous entries for sole completion on a directory · 1df77035
      Sean Farley authored
      Previously, directories were added with the trailing slash and, if there was
      only one completion, then another ambiguous entry was created using '.', as
      follows:
      
      $ hg rm mer<TAB>
      mercurial/./  mercurial//
      
      This was added in fa6d5c62f3bd (though, some logic existed before that) to work
      around bash completion adding a space after the sole entry because we treated
      directories and files the same. We no longer do that now so we remove this
      unneeded code.
      
      Tests have been updated to match this new behavior.
      1df77035
  17. Nov 26, 2013
Loading