Commit Graph

3944 Commits

Author SHA1 Message Date
Matt Mackall
776084cff3 pushkey: use UTF-8 2010-11-28 18:21:47 -06:00
Matt Mackall
8b31da4540 branch: operate on branch names in local string space where possible
Previously, branch names were ideally manipulated as UTF-8 strings,
because they were stored as UTF-8 in the dirstate and the changelog
and could not be safely converted to the local encoding and back.

However, only about 80% of branch name code was actually using the
right encoding conventions. This patch uses the localstr addition to
allow working on branch names as local strings, which simplifies
handling so that the previously incorrect code becomes correct.
2010-11-24 15:56:32 -06:00
Matt Mackall
c7059d3926 encoding: add localstr class to track UTF-8 version of transcoded strings
This allows UTF-8 strings to losslessly round-trip through Mercurial
2010-11-24 15:38:52 -06:00
Matt Mackall
8e2f7d14eb merge with stable 2010-11-22 13:11:46 -06:00
Adrian Buehlmann
db484176ce tests: integrate test-hardlinks-safety.t into test-hardlinks.t
Should make running the testsuite a bit faster.

Also, test-hardlinks.t and test-hardlinks-safety.t now have enough
infrastructure in common.
2010-11-22 17:32:51 +01:00
Steve Losh
72ee3af1d8 mq: add an '-e/--exact' option to qpush
This patch adds an '--exact/-e' option to qpush that will try to push the
patches in the correct location in the DAG.  Specifying this option does the
following:

* If --move is specified, abort. It makes no sense to move a patch to the front
  of the queue and try to apply it to its parent, because its parent is one of
  the patches we just moved it in front of!
* If patches are already applied, abort. We don't want patch changesets
  scattered throughout the DAG.
* If local changes are present, abort unless --force is used, as usual.
* Find the first patch we're going to push (if we're pushing multiple patches
  with a target or --all).
* If that patch doesn't have a parent, abort, obviously.
* If the parent doesn't exist in the repo, abort.  Something is wrong.
* Update to the parent, then continue pushing the patches as normal.
2010-11-17 21:18:44 -05:00
Martin Geisler
6a3d9310ab code style: prefer 'is' and 'is not' tests with singletons 2010-11-22 18:15:58 +01:00
Eric Eisner
47f74e81de subrepo: lazier git push logic
Avoids calls to git push when the revision is already known to be
in the remote repository. Now, when using a read-only git subrepo,
git will never need to talk to its upstream repository.
2010-11-21 22:00:51 -05:00
Eric Eisner
0e03c676b5 subrepo: archive git subrepos 2010-11-18 19:20:21 -05:00
Adrian Buehlmann
5e2e71ea82 check-code: catch Python 'is' comparing number or string literals
The Python 'is' operator compares object identity, so it should
definitely not be applied to string or number literals, which Python
implementations are free to represent with a temporary object.

This should catch the following kinds of bogus expressions (examples):

  x is 'foo'     x is not 'foo'
  x is "bar"     x is not "bar"
  x is 42        x is not 42
  x is -36       x is not -36

As originally proposed by Martin Geisler, amended with catching
negative numbers.
2010-11-21 11:52:27 +01:00
Patrick Mezard
ad186e82b5 Merge with stable 2010-11-21 13:16:59 +01:00
timeless
2f8d0b40e3 record: quote command in use hg commit message 2010-11-21 05:07:06 -06:00
timeless
f425b70af2 revert: improve merge advice and favor its error over all 2010-11-20 20:41:48 +02:00
Henrik Stuart
54e1841c4f rebase: support --detach when null is common ancestor 2010-11-20 09:51:56 +01:00
Patrick Mezard
2539fe4ece subrepo: handle missing subrepo spec file as removed
Otherwise, all commands involving a dirstate walk will abort when trying to
readone of them. Deleting .hgsub basically breaks a repository.
2010-11-18 23:05:10 +01:00
Patrick Mezard
f94cde7dfe subrepo: prune empty directories when removing svn subrepo 2010-11-17 21:25:23 +01:00
Adrian Buehlmann
3eb9fea74e test-hardlinks: add testcase for repo copied with 'cp -al'
This patch adds a case to test-hardlinks.t which demonstrates that
hardlinks in the working directory are broken up (using 'hg update').

Motivation for this patch:

'hg help clone' shows copying repositories *and* the working directory
using 'cp -al', creating hardlinks in the *working directory* too (not
just in the store).

Note that we can't use 'cp -al' since for example MacOS X doesn't
support these options on cp. I'm thus using the same trick as in
test-hardlinks-safety.t for creating hardlinks in the working dir.
2010-11-17 16:54:30 +01:00
Patrick Mezard
4795589405 Merge with stable 2010-11-18 23:15:13 +01:00
Patrick Mezard
4c85200b1f Merge with stable 2010-11-17 21:30:13 +01:00
Kevin Bullock
79f5039252 mq: ignore subrepos (issue2499)
If MQ allows modifying .hgsub or .hgsubstate in a patch, it can easily
lead to an inconsistent subrepo state. This patch prevents qrefresh from
adding any modifications to .hgsub or .hgsubstate to a patch. The user
is warned that these files are not included in the patch.

The tests test both the slightly irrational and the pathological cases.
2010-11-16 13:06:07 -06:00
Colin Caughie
83d5ec6c25 eol: exclude .hgtags file from eol translation (issue2493) 2010-11-13 15:02:02 +01:00
Nicolas Dumazet
c2c4887231 log: fix log -rREV FILE when REV isnt the last filerev (issue2492)
Regression from 9f0026001bfd. That previous commit is not supposed
to affect log calls without --follow, so we step out of this
codepath if follow is not True, and it's enough to fix the
regression.

When --follow is given, we fix the issue by taking into account
changesets that have a rev > maxrev to build the filegraph: even if
those files are not included in the final result, it's still needed
to walk correctly the graph from the end of the filelog to minrev, to
track accurately renames.
2010-11-11 02:10:37 +09:00
Matt Mackall
509a829041 pushkey: force HTTP POST on push and add tests (issue2489) 2010-11-12 01:21:45 -06:00
Adrian Buehlmann
6a2a2ac76d tests: add test-hardlinks.t
partially testing util.opener.__call__
2010-11-10 17:28:24 +01:00
Klaus Koch
ac02ce2890 bundlerepository: get rid of temporary bundle files (issue2478)
This bug was introduced in a768ccd401c8 and 90b501357394.
2010-11-07 20:18:57 +01:00
Dan Villiom Podlaski Christiansen
1f3bc401af test-mq-qnew: handle Mac OS X error strings.
On Mac OS X, opening a file called '42/' results in ENOENT and not
EISDIR if the directory doesn't exist.
2010-11-10 13:48:23 +01:00
Erik Zielke
fae4edd371 run-test: fixed wrong parenthesis
Fixed wrong placement of end parenthesis, from 8b0591f8d1cd
2010-11-08 10:56:47 +01:00
Nicolas Dumazet
74d80b6b4f graphmod: safer code when a changeset has two identical parents
While this situation should never under normal use, some real
life repos sometimes contain such changesets (older hg versions,
broken rebases, etc...)

hgweb was displaying an "Internal error" in this case, and graphlog
displayed a redundant branch all the way to null: it does not cost us
much to just ignore this extra parent when constructing the DAG.
2010-11-08 22:45:56 +09:00
Nicolas Dumazet
f48c256c16 revlog: fix descendants() if nullrev is in revs
We were not returning the correct result if nullrev was in revs, as we
are checking parent(currentrev) != nullrev before yielding currentrev

test-convert-hg-startrev was wrong: if we start converting from rev -1 and
onwards, all the descendants of -1 (full repo) should be converted.
2010-11-07 18:23:48 +09:00
Mads Kiilerich
8e085520f4 tests: use (esc) instead of other kinds of string escaping 2010-11-08 01:41:42 +01:00
Mads Kiilerich
635406bf76 tests: use (esc) for all non-ASCII test output 2010-11-08 01:41:41 +01:00
Mads Kiilerich
82954d10d1 tests: use (esc) markup for string-escape
This makes test output less ambiguous.

Failing test output will be escaped and marked up if necessary. A Python
string-escape compatible encoding is used, but not everything is encoded -
especially not \n and \t and '.
2010-11-08 01:35:41 +01:00
Mads Kiilerich
8c125f4b6b tests: (no-eol) markup for command output without trailing LF
Output chunks without a trailing LF will now work but get (no-eol) appended.

This change mostly moves code around so we can handle that an output line
starts with data from previous command, followed by salt and the next command.
2010-11-08 01:35:40 +01:00
Mads Kiilerich
2fcf673aef tests: handle .t files without trailing LF
203ffed27f86 made this simple test-test.t succeed silently:
  $ printf '  $ true' > test-test.t
but did not give a usable .err in this case:
  $ printf '  $ false' > test-test.t

The missing LF will now be fixed in the test output and it will thus give a
test failure and a solution in the .err file.
2010-11-06 00:31:44 +01:00
Steve Losh
3171599307 alias: fall back to normal error handling for ambigious commands (fixes issue2475) 2010-11-05 15:54:32 -04:00
Ronny Pfannschmidt
7701046742 subrepo: test & fix svn subrepo removal 2010-11-05 15:13:22 +01:00
Erik Zielke
cd95a50630 minirst: improved support for option lists.
This enables minirst to parse and print option lists which have both
long and short options. Before, we could only parse option lists with
long options.
2010-11-02 17:44:19 +01:00
Dan Villiom Podlaski Christiansen
56cb66ebbb test-subrepo-git.t: portability fix.
Specifying arguments after file names for 'ls' is a GNU extension.
2010-11-16 13:29:35 +01:00
Erik Zielke
87792363c2 minirst: modified minirst to also recognize empty comments.
The modifies minirst to also handle empty comments. An empty comment
is a block with a single line containing two dots.
2010-11-16 13:29:08 +01:00
Nicolas Dumazet
7292968c6f run-tests: fix --debug for .t tests
When --debug is given to the test runner, run() returns (retcode, None).
Do not try to use None output as a string, and return directly, similarly
as other testers.
2010-11-16 10:33:19 +09:00
Adrian Buehlmann
c5ab776a53 discovery: list new remote heads in prepush() on --debug
With this patch applied, Mercurial will list the hashes of new remote heads
if push --debug aborts because of new remote heads (option -f/--force not set).

Example:

  $ hg push --debug repo1
  using http://example.org/repo1
  http auth: user johndoe, password not set
  sending between command
  pushing to http://example.org/repo1
  sending capabilities command
  capabilities: changegroupsubset stream=1 lookup pushkey unbundle=HG10GZ,HG10BZ,HG10UN branchmap
  sending heads command
  searching for changes
  common changesets up to 187dd3f0a37d
  sending branchmap command
  new remote heads on branch 'default'        <- new output line
  new remote head 5862c07f53a2                <- new output line
  abort: push creates new remote heads on branch 'default'!
  (did you forget to merge? use push -f to force)

Compare to without --debug (not changed by this patch, including it here
for reference purposes only):

  $ hg push repo1
  pushing to http://example.org/repo1
  searching for changes
  abort: push creates new remote heads on branch 'default'!
  (did you forget to merge? use push -f to force)

Motivation for this change:

'hg outgoing' may list a whole lot of benign changesets plus an odd changeset
that will trigger the "new remote heads" abort. It can be hard to spot that
single unwanted changeset (it may be an old forgotten experiment, lingering
in the local repo).

"hg log -r 'heads(outgoing())'" might be useful, but that also lists a head
that may be benign on push.

Inside prepush(), we already know which heads are causing troubles on 'hg push'.
Why not make that info available (at least on --debug)?

This would also be helpful for doing remote support, as the supporter can ask
the user to paste the output of 'hg push --debug' on error and then ask further
questions about the heads listed.
2010-11-11 15:51:20 +01:00
Eric Eisner
c8106b69bb subrepo: removing (and restoring) git subrepo state 2010-11-14 18:31:40 -05:00
Eric Eisner
7c9ab4f118 subrepo: update and merge works with any git branch 2010-11-14 18:31:29 -05:00
Eric Eisner
22744d6861 subrepo: allow git subrepos to push and merge
(master branch only)

gitsubrepo based on patch from David Soria Parra:
http://bitbucket.org/segv/davids-poor-git-subrepo-attempt/
2010-11-14 18:22:33 -05:00
Eric Eisner
244b8e45a7 subrepo: cloning and updating of git subrepos
gitsubrepo based on patch from David Soria Parra:
http://bitbucket.org/segv/davids-poor-git-subrepo-attempt/
2010-11-14 18:20:13 -05:00
Eric Eisner
579b798395 subrepo: support for adding a git subrepo
gitsubrepo based on patch from David Soria Parra:
http://bitbucket.org/segv/davids-poor-git-subrepo-attempt/
2010-11-14 18:15:26 -05:00
Martin Geisler
4fd0f0e58d test-win32text: use $TESTTMP in output 2010-11-13 15:20:37 +01:00
Martin Geisler
338d9e28eb test-win32text: use (esc) lines instead of Python script 2010-11-13 15:16:50 +01:00
Martin Geisler
d9339ae620 merge with stable 2010-11-13 15:12:09 +01:00
Nicolas Dumazet
1126494b0f merge with stable 2010-11-13 11:58:51 +09:00