Skip to content
Snippets Groups Projects
  1. Oct 15, 2011
  2. Oct 14, 2011
  3. Oct 13, 2011
    • Greg Ward's avatar
      merge: expand environment variables and ~/ in tool.executable · 157d93c4
      Greg Ward authored
      hgrc(5) already implies that this works, so we might as well support it.
      
      Another approach would be to implement this in util.findexe(): that
      would benefit other callers of findexe(), e.g. convert and anyone
      calling the user's editor. But findexe() is really implemented in
      both posix.py and windows.py, so this would make both of those modules
      depend on util.py: not good. So keep it narrow and only for merge
      tools.
      157d93c4
  4. Oct 15, 2011
  5. Oct 14, 2011
  6. Oct 31, 2010
    • kiilerix's avatar
      mq: fix corner cases for handling of patch 0 in qselect · 8caf7a75
      kiilerix authored
      Most of the code paths in mq would always pass patch specifications as a
      string. Patches can be specified by their index, but one code path passed that
      (through pop) to lookup as an integer - all other code paths used a string.
      
      Unfortunately pop and lookup (like many other parts of mq) used the boolean
      value of the patch specification to see if it was None, and they would thus
      incorrectly handle patch 0 as None.
      
      This patch makes the code comply with the actual internal duck typing of patch
      specifications: patch indices must be encoded as strings. The (now) unused code
      for partial and thus incorrect handling of indices as integers is removed.
      8caf7a75
  7. Oct 14, 2011
    • Greg Ward's avatar
      largefiles: cosmetics, whitespace, code style · 7ab05d75
      Greg Ward authored
      This is mainly about keeping code under the 80-column limit with as
      few backslashes as possible. I am deliberately not making any logic or
      behaviour changes here and have restrained myself to a few "peephole"
      refactorings.
      7ab05d75
    • Greg Ward's avatar
      largefiles: more work on cleaning up comments · dd03d3a9
      Greg Ward authored
      - always say "largefile", not "lfile"
      - cleanup mangled syntax, hopefully correctly
        (punctuation: it's your friend!)
      - wrap to 75 columns (where feasible)
      dd03d3a9
    • Greg Ward's avatar
      largefiles: improve error reporting · 67d01077
      Greg Ward authored
      - tweak wording of some error messages
      - use consistent capitalization
      - always say 'largefile', not 'lfile'
      - fix I18N problems
      - only raise Abort for errors the user can do something about
      67d01077
  8. Oct 13, 2011
  9. Oct 31, 2010
  10. Oct 13, 2011
  11. Oct 12, 2011
    • Matt Mackall's avatar
    • Matt Mackall's avatar
      graft: add --continue support · e4d13563
      Matt Mackall authored
      e4d13563
    • Matt Mackall's avatar
      graft: add user, date, and tool options · bfb93963
      Matt Mackall authored
      bfb93963
    • Matt Mackall's avatar
      graft: add --edit · f5d9d0d0
      Matt Mackall authored
      f5d9d0d0
    • Matt Mackall's avatar
      graft: add initial implementation · 2d710c12
      Matt Mackall authored
      2d710c12
    • Augie Fackler's avatar
      bookmarks: delegate writing to the repo just like reading · 7196ed7a
      Augie Fackler authored
      This makes it easier for alternate storage backends to not use flat
      files for bookmarks storage.
      7196ed7a
    • Idan Kamara's avatar
      tests: add support for inline doctests in test files · 4fae5df4
      Idan Kamara authored
      This adds doctest like syntax to .t files, that can be interleaved with regular
      shell code:
      
        $ echo -n a > file
        >>> print open('file').read()
        a
        >>> open('file', 'a').write('b')
        $ cat file
        ab
      
      The syntax is exactly the same as regular doctests, so multiline statements
      look like this:
      
        >>> for i in range(3):
        ...     print i
        0
        1
        2
      
      Each block has its own context, i.e.:
      
        >>> x = 0
        >>> print x
        0
        $ echo 'foo'
        foo
        >>> print x
      
      will result in a NameError.
      
      Errors are displayed in standard doctest format:
      
        >>> print 'foo'
        bar
      
        --- /home/idan/dev/hg/default/tests/test-test.t
        +++ /home/idan/dev/hg/default/tests/test-test.t.err
        @@ -2,3 +2,16 @@
           > >>> print 'foo'
           > bar
           > EOF
        +  **********************************************************************
        +  File "/tmp/tmps8X_0ohg-tst", line 1, in tmps8X_0ohg-tst
        +  Failed example:
        +      print 'foo'
        +  Expected:
        +      bar
        +  Got:
        +      foo
        +  **********************************************************************
        +  1 items had failures:
        +     1 of   1 in tmps8X_0ohg-tst
        +  ***Test Failed*** 1 failures.
        +  [1]
      
      As for the implementation, it's quite simple: when the test runner sees a line
      starting with '>>>' it converts it, and all subsequent lines until the next
      line that begins with '$' to a 'python -m heredoctest <<EOF' call with the
      proper heredoc to follow. So if we have this test file:
      
        >>> for c in 'abcd':
        ...     print c
        a
        b
        c
        d
        $ echo foo
        foo
      
      It gets converted to:
      
        $ python -m heredoctest <<EOF
        > >>> for c in 'abcd':
        > ...     print c
        > a
        > b
        > c
        > d
        > EOF
        $ echo foo
        foo
      
      And then processed like every other test file by converting it to a sh script.
      4fae5df4
    • Idan Kamara's avatar
      tests: add helper script for processing doctests read from stdin · f7044da7
      Idan Kamara authored
      Writes stdin to a temp file and doctests it.
      
      In the future we might want to spare the temp file and directly call into
      doctest.
      
      Also, with some tweaking it seems possible to adjust the line numbers reported
      in an error report so they match the ones in the original file.
      f7044da7
Loading