Commit Graph

15177 Commits

Author SHA1 Message Date
Pierre-Yves David
adb2912b0c rebase: add --rev option to rebase
This option allow a strict set of revision to be specified instead of using -s
or -b. Rebase will refuse start if striping  rebased changeset will strip non
rebased changeset. Rebase will refuse to work on set with multiple root.
2011-10-15 20:12:32 +02:00
Matt Mackall
ab3ca664ae rebase: allow revsets for source and base args 2011-10-15 12:57:47 -05:00
Matt Mackall
2ba9ce4879 revset: fix %r handling in formatspec 2011-10-15 12:52:43 -05:00
Pierre-Yves David
92a70ff8aa rebase: use revset as soon as possible in internal logic
The buildstate function now take a set of revs. Logic related to --source and
--base option have been moved in the main rebase function.

In the process this fixes a bug where the wrong source changeset might be pick.
This explain the changes in hgext/rebase.py
2011-10-15 19:07:51 +02:00
Matt Mackall
275981abb2 revset: add %r for embedded revset support to formatspec
This allows folding external revsets or lists of revsets into a revset
expression. Revsets are pre-parsed for validity so that syntax errors
don't escape.
2011-10-15 10:20:08 -05:00
Angel Ezquerra
16f9562667 revert: warn that subrepos cannot be reverted
(tests added by mpm)
2011-10-15 01:06:52 +02:00
Greg Ward
aeec456986 merge: expand environment variables and ~/ in tool.executable
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.
2011-10-12 21:45:58 -04:00
Matt Mackall
3e9b4998db minirst: improve test harness 2011-10-15 00:39:06 -05:00
Matt Mackall
7791d14df5 minirst: add style flag to format 2011-10-15 00:39:04 -05:00
Matt Mackall
cdd258d4fd minirst: add basic HTML formatting support 2011-10-15 00:39:01 -05:00
Matt Mackall
7751048134 graft: use status verbosity for reporting grafts 2011-10-14 15:40:50 -05:00
Idan Kamara
8bbad7ebee contrib: add a script to help diagnose raw output of the cmdserver 2011-10-14 19:10:36 +02:00
Idan Kamara
68b09c8a1d mq: eliminate explicit checks for file existence 2011-10-14 19:51:46 +02:00
Mads Kiilerich
ab16679cb8 mq: cleanup of lookup - handling of None is not relevant
Patch specifications in mq is passed around as a string or None. None is
generally used when no patch has been specified and there thus is nothing to
lookup and the calling code should do something else. One code path did however
pass None all the way to lookup. That case was handled in lookup, but there was
really need for that, it was undocumented, and it used to cause trouble back
when patches was specified as integers.
2011-10-14 02:50:06 +02:00
Mads Kiilerich
9c69ab7b0b mq: fix corner cases for handling of patch 0 in qselect
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.
2010-10-31 18:29:56 +01:00
Greg Ward
9201e11906 largefiles: cosmetics, whitespace, code style
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.
2011-10-13 21:42:54 -04:00
Greg Ward
f01e46c64d largefiles: more work on cleaning up comments
- always say "largefile", not "lfile"
- cleanup mangled syntax, hopefully correctly
  (punctuation: it's your friend!)
- wrap to 75 columns (where feasible)
2011-10-13 20:45:49 -04:00
Greg Ward
8b7a685468 largefiles: improve error reporting
- 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
2011-10-13 20:24:29 -04:00
Greg Ward
5f73b6d815 largefiles: improve comments, internal docstrings
- fix some ungrammatical/unclear/incorrect comments/docstrings
- rewrite some really unclear comments/docstrings
- make formatting/style more consistent with the rest of Mercurial
  (lowercase without period unless it's really multiple sentences)
- wrap to 75 columns
- always say "largefile(s)", not "lfile(s)" (or "big files")
- one space between sentences, not two
2011-10-12 20:59:27 -04:00
Na'Tosha Bard
783d9072f7 largefiles: flush out tests to cover more operations and known cornercases 2011-10-13 15:15:32 +02:00
Na'Tosha Bard
6b1f4db174 largefiles: speed up commit by only rewriting standins for modified largefiles 2011-10-13 12:11:25 +02:00
Idan Kamara
2f9b12fec9 tests: add basic tests for doctest syntax 2011-10-13 17:54:38 +02:00
Idan Kamara
3cb661bac7 run-tests: end doctest block when seeing a non-command 2011-10-13 17:54:37 +02:00
Idan Kamara
03e76d64ac tests: remove temp doctest file when finished running it 2011-10-13 17:54:35 +02:00
Mads Kiilerich
c91fb0e17c httprepo: make __del__ more stable in error situations
Some errors could leave self.urlopener uninitialized and thus cause strange
crashes in __del__.

This member variable is now "declared statically" and checked for assignment
before use.
2011-10-13 04:27:49 +02:00
Mads Kiilerich
f8aad4bae1 tests: exercise some corner cases for mq guard selection and --reapply 2010-10-31 18:29:55 +01:00
Mads Kiilerich
2d6cf89687 tests: cleanup of test-fetch.t 2011-10-13 04:27:49 +02:00
Mads Kiilerich
6260903881 tests: cleanup of echo statements left over from test conversion 2011-10-13 04:27:49 +02:00
Matt Mackall
3c9792e3dc graft: add examples and information about copied metadata 2011-10-12 18:59:59 -05:00
Matt Mackall
1841aff181 graft: add --continue support 2011-10-12 18:48:57 -05:00
Matt Mackall
d5e94e6c90 graft: add user, date, and tool options 2011-10-12 18:46:23 -05:00
Matt Mackall
0069040fa2 graft: add --edit 2011-10-12 18:46:03 -05:00
Matt Mackall
06ac7c8606 graft: add initial implementation 2011-10-12 18:45:36 -05:00
Augie Fackler
6d4a8aa3a9 bookmarks: delegate writing to the repo just like reading
This makes it easier for alternate storage backends to not use flat
files for bookmarks storage.
2011-10-12 11:09:57 -05:00
Idan Kamara
cb06843ca5 tests: add support for inline doctests in test files
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.
2011-10-12 22:01:14 +02:00
Idan Kamara
36075d5498 tests: add helper script for processing doctests read from stdin
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.
2011-10-12 22:01:13 +02:00
Eric Roshan Eisner
070c37b77f subrepo: fix git branch tracking logic (issue2920) 2011-10-11 21:34:55 -07:00
Augie Fackler
b0cd40af6a alias: don't shadow commands that we only partially matched (issue2993) (BC)
Previously, if you set an alias for "ci", it'd also shadow "commit"
even though you didn't specify that. This occurred for all commands
with explicit short variations.
2011-10-11 17:20:03 -05:00
Pierre-Yves David
ad8f123b6d resolve: update documentation to mention the .orig backup 2011-10-11 18:48:45 +02:00
Eric Roshan Eisner
a6f358182b cmdutil.bailifchanged: abort for dirty subrepos 2011-10-11 18:18:15 -07:00
Greg Ward
45dea8085f largefiles: improve help
Extension help taken from the URL formerly in the text
(https://developers.kilnhg.com/Repo/Kiln/largefiles/largefiles/File/usage.txt)
and improved.
2011-10-11 21:10:03 -04:00
Greg Ward
7c5da0f076 largefiles: use ui.configlist() to split largefiles.patterns 2011-10-11 21:11:01 -04:00
Greg Ward
86647ec1cf largefiles: allow minimum size to be a float
Some old-fashioned people (e.g. me) think that incompressible
binary files >100 kB count as "large".
2011-10-11 21:07:08 -04:00
Greg Ward
184d4727fd largefiles: factor out lfutil.getminsize() 2011-10-11 21:11:01 -04:00
Na'Tosha Bard
842085d82b largefiles: cleanup import, now that we can assume > 1.9 for bundled extension 2011-10-11 14:01:24 +02:00
Na'Tosha Bard
8fc1950f68 largefiles: add test for status 2011-10-11 13:15:29 +02:00
Na'Tosha Bard
a090606e6c largefiles: remove pre-1.9 code from extension first bundled with 1.9 2011-10-11 10:42:56 +02:00
Matt Mackall
944b7f7b5c pyflakes: clean up some import noise 2011-10-11 23:16:05 -05:00
Matt Mackall
776ce88bdd bdiff: fix pointer aliasing 2011-10-11 20:21:13 -05:00
Matt Mackall
72fd6652f4 import: add --edit switch 2011-10-11 08:32:04 -05:00