Commit Graph

4229 Commits

Author SHA1 Message Date
Brodie Rao
40c99bbacb url: add trailing slashes to URLs with hostnames that don't have one
This works around a potential issue in Python 2.4 where cloning a repo
with a URL like http://foo:8080 would cause urllib2 to query on
http://foo:8080?cmd=capabilities instead of
http://foo:8080/?cmd=capabilities.

In the past, this issue has been masked by the fact that
url.getauthinfo() added a trailing slash when it was missing.
2011-03-30 20:00:23 -07:00
Matt Mackall
b92d665cf7 url: fix tests 2011-03-30 14:42:41 -05:00
David Soria Parra
c0e729f18b bookmarks: do not forward merged bookmark (issue1877) 2011-03-14 23:50:28 +01:00
Kevin Berridge
58214a3429 pull: new output message when there are multiple branches
Pull outputs a slightly new message when there are multiple branches and
the current branch has many heads:
(run 'hg heads .' to see heads, 'hg merge' to merge)

This message adds the "." in hg heads to encourage you to consider only the
current branch's heads.
2011-03-28 20:56:56 -04:00
Kevin Berridge
87ae31d662 pull: don't suggest running hg merge when new heads are on different branches
After a pull when new heads are added but no head is added on the current
branch, the "run 'hg merge'" message can be misleading.  This patch doesn't
output the merge message in that scenario.
2011-03-11 20:43:12 -05:00
Adrian Buehlmann
b6b4efebd6 test-paths.t: 'file:' disables [paths] entries for clone dest 2011-03-29 19:20:28 +02:00
Daniel Atallah
54e55b4dbb convert/mtn: Fix conversion of large files from mtn (broken in 64963df7238d)
"mtn automate stdio" will break output larger than 32kB into several packets.
This ensures that we are processing all the output on the main stream and not
only the last packet.
2011-03-28 23:16:20 -04:00
Brendan Cully
f05749f48c Fix transplant error message to correspond with test 2011-03-28 21:36:29 -07:00
Luke Plant
bd1d8463c8 transplant: fix crash if filter script munges log file
This fixes an UnboundLocalError crash if the filter script removes the
'User' or 'Date' lines from the log file.
2011-03-28 21:17:32 +01:00
Matt Mackall
7fbf746bf2 changegroup: fold progress meter into callbacks
progress meters now start at 1 rather than 0
2011-03-28 11:18:56 -05:00
Idan Kamara
2f140a443a util: dates cannot consist entirely of whitespace (issue2732) 2011-03-27 23:48:58 +02:00
Daniel Atallah
e07af26e9b convert/mtn: convert suspended branches as closed branches
Monotone treats branch closing ("suspending") in a similar manner to how we do
in mercurial - a cert is added to a revision that marks the branch to be hidden.
If a subsequent commit is made, the branch is effectively reopened.
2011-03-25 15:49:43 -04:00
Stefano Tortarolo
c32fbcbea1 rebase: don't mark file as removed if missing in parent's manifest (issue2725) 2011-03-27 13:34:20 +02:00
Martin Geisler
73d96c7696 ui: label prompts, default to yellow prompts 2011-03-27 12:59:25 +02:00
Brodie Rao
186bc90ec4 url: provide url object
This adds a url object that re-implements urlsplit() and
unsplit(). The implementation splits out usernames, passwords, and
ports.

The implementation is based on the behavior specified by RFC
2396[1]. However, it is much more forgiving than the RFC's
specification; it places no specific restrictions on what characters
are allowed in each segment of the URL other than what is necessary to
split the URL into its constituent parts.

[1]: http://www.ietf.org/rfc/rfc2396.txt
2011-03-25 22:58:56 -07:00
Adrian Buehlmann
af6e59941f debugstate: add new --datesort option
sorts the output lines by mtime, then by filename
2011-03-26 10:59:33 +01:00
Stefano Tortarolo
fc18863354 rebase: restore mq guards after rebasing (issue2107)
Guards on rebased mq patches were lost.
This patch restores them after the qimporting step.
2011-03-26 13:05:17 +01:00
Idan Kamara
416ff8e770 tests: no need to explicitly export HOME in test files
the test runner ensures that HOME is set to a temp dir
2011-03-25 22:18:05 +02:00
Idan Kamara
acaa24b982 tests: set HOME to the test temp dir (issue2707) 2011-03-25 22:15:37 +02:00
Patrick Mezard
9c572be237 test-extdiff: fix 60da34df26da temporary dir output 2011-03-25 16:46:19 +01:00
Edouard Gomez
4060d3d548 convert: add bookmarks reading support to git backend 2011-03-25 01:38:43 +01:00
Matt Mackall
8a9a6325b4 ssh: fix password test
We don't support passwords in ssh URLs, and neither do some versions
of Python's urllib. Since we don't actually care much here, punt with
a glob in the test.
2011-03-24 15:12:51 -05:00
Lee Cantey
6816acddec Fix expected url to match test. 2011-03-24 08:51:58 -07:00
Patrick Mezard
92074cd441 patch: deprecate ui.patch / external patcher feature
Why?
- Mercurial internal patcher works correctly for regular patches and git
  patches, is much faster at least on Windows and is more extensible.
- In theory, the external patcher can be used to handle exotic patch formats. I
  do not know any and have not heard about any such use in years.
- Most patch programs cannot handle git format patches, which makes the API
  caller to decide either to ignore ui.patch by calling patch.internalpatch()
  directly, or take the risk of random failures with valid inputs.
- One thing a patch program could do Mercurial patcher cannot is applying with
  --reverse. Apparently several shelve like extensions try to use that,
  including passing the "reverse" option to Mercurial patcher, which has been
  removed mid-2009. I never heard anybody complain about that, and would prefer
  reimplementing it anyway.

And from the technical perspective:
- The external patcher makes everything harder to maintain and implement. EOL
  normalization is not implemented, and I would bet file renames, if supported
  by the patcher, are not correctly recorded in the dirstate.
- No tests.

How?
- Remove related documentation
- Clearly mark patch.externalpatch() as private
- Remove the debuginstall check. This deprecation request was actually
  triggered by this last point. debuginstall is the only piece of code patching
  without a repository. When migrating to an integrated patch() + updatedir()
  call, this was really a showstopper, all workarounds were either ugly or
  uselessly complicated to implement. If we do not support external patcher
  anymore, the debuginstall check is not useful anymore.
- Remove patch.externalpatch() after 1.9 release.
2011-03-24 10:28:29 +01:00
Matt Mackall
49184b9450 # User Dan Villiom Podlaski Christiansen <danchr@gmail.com>
# Date 1289564504 -3600
# Node ID b75264c15cc888cf38c3c7b8f619801e3c2589c7
# Parent  89b2e5d940f669e590096c6be70eee61c9172fff
revsets: overload the branch() revset to also take a branch name.

This should only change semantics in the specific case of a tag/branch
conflict where the tag wasn't done on the branch with the same
name. Previously, branch(whatever) would resolve to the branch of the
tag in that case, whereas now it will resolve to the branch of the
name. The previous behaviour, while documented, seemed very
counter-intuitive to me.

An alternate approach would be to introduce a new revset such as
branchname() or namedbranch(). While this would retain backwards
compatibility, the distinction between it and branch() would not be
readily apparent to users. The most intuitive behaviour would be to
have branch(x) require 'x' to be a branch name, and something like
branchof(x) or samebranch(x) do what branch(x) currently
does. Unfortunately, our backwards compatibility guarantees prevent us
from doing that.

Please note that while 'hg tag' guards against shadowing a branch, 'hg
branch' does not. Besides, even if it did, that wouldn't solve the
issue of conversions with such tags and branches...
2011-03-23 19:28:16 -05:00
Adrian Buehlmann
1e28a3847c test-commit-multiple.t: improve committwice.py
- fix bug in replacebyte: parameter fn wasn't used (no harm done)
- remove unneeded matcher
- remove unused local n
- increase test coverage a bit with a second file and some sleeping
- show files changed in revisions
- move print statements out of racy path to make sure it's as racy as possible
2011-03-23 22:58:40 +01:00
Peter Arrenbrecht
8f2d068a05 discovery: avoid discovery when local graph is a subset of remote
Immediately sends local's heads to the server to check whether the server knows them all.
If it does, we can call getbundle immediately.

Interesting test output changes are:

-  added 1 changesets with 0 changes to 1 files (+1 heads)
+  added 1 changesets with 0 changes to 0 files (+1 heads)

-> The new getbundle() actually fixes a bug vs. changegroupsubset() in that it no longer
returns unnecessary files when file revs are reused.

warning: repository is unrelated
+  requesting all changes

-> The new use of common instead of bases correctly indicates that an unrelated pull
gets all changes from the server.
2011-03-23 16:06:55 +01:00
Peter Arrenbrecht
6646f48826 wireproto: add getbundle() function
getbundle(common, heads) -> bundle

Returns the changegroup for all ancestors of heads which are not ancestors of common. For both
sets, the heads are included in the set.

Intended to eventually supercede changegroupsubset and changegroup. Uses heads of common region
to exclude unwanted changesets instead of bases of desired region, which is more useful and
easier to implement.

Designed to be extensible with new optional arguments (which will have to be guarded by
corresponding capabilities).
2011-03-23 16:02:11 +01:00
Stefano Tortarolo
40d3a3beb3 rebase: allow for rebasing descendants onto ancestors on different named branches
So far we've been denying rebasing descendants onto ancestors, but there are
situations in which this kind of operation makes perfect sense to me.

Let's say we have made a commit (or more), that belongs to branch 'dev', on
top of the named branch 'stable':

... a (stable) - b (dev)

but then we realize that b should belong to branch 'stable'.
In these cases a rebase means: "move these csets from named branch A to named
branch B" and there isn't a valid reason to deny it.

This patch basically doesn't block it, if source and destination are
on different named branches.
The old behaviour still applies for rebases across the same named branch.

Can you think of any tricky corner cases in which this new behaviour could
lead to problems? (I bet there are tons of them...)

By the way, I created a brand new .t because I feel there should be more
tests I can't think of at the moment.
2011-03-23 01:14:43 +01:00
Peter Arrenbrecht
4e49d0830f commands: add debugbundle command
Lists ids contained in a bundle file. Useful for testing bundle-related commands.
2011-03-22 09:22:29 +01:00
Peter Arrenbrecht
d542bac8c7 wireproto: add known([id]) function
known([Node]) -> [1/0]

Returns 1/0 for each node, indicating whether it's known by the server.
Needed for new discovery protocols introduced in later patches.
2011-03-22 09:22:21 +01:00
Peter Arrenbrecht
5925b26799 wireproto: fix handling of '*' args for HTTP and SSH 2011-03-22 07:38:32 +01:00
Peter Arrenbrecht
375ab88b9f debug: add debugwireargs to test argument passing over the wire
Tests argument passing locally, via HTTP, and via SSH. This is mainly preparation
for the next patch.
2011-03-22 07:38:32 +01:00
Greg Ward
4bcecd8160 dirstate: avoid a race with multiple commits in the same process
(issue2264, issue2516)

The race happens when two commits in a row change the same file
without changing its size, *if* those two commits happen in the same
second in the same process while holding the same repo lock.  For
example:

  commit 1:
    M a
    M b
  commit 2:           # same process, same second, same repo lock
    M b               # modify b without changing its size
    M c

This first manifested in transplant, which is the most common way to
do multiple commits in the same process. But it can manifest in any
script or extension that does multiple commits under the same repo
lock. (Thus, the test script tests both transplant and a custom script.)

The problem was that dirstate.status() failed to notice the change to
b when localrepo is about to do the second commit, meaning that change
gets left in the working directory. In the context of transplant, that
means either a crash ("RuntimeError: nothing committed after
transplant") or a silently inaccurate transplant, depending on whether
any other files were modified by the second transplanted changeset.

The fix is to make status() work a little harder when we have
previously marked files as clean (state 'normal') in the same process.
Specifically, dirstate.normal() adds files to self._lastnormal, and
other state-changing methods remove them. Then dirstate.status() puts
any files in self._lastnormal into state 'lookup', which will make
localrepository.status() read file contents to see if it has really
changed.  So we pay a small performance penalty for the second (and
subsequent) commits in the same process, without affecting the common
case.  Anything that does lots of status updates and checks in the
same process could suffer a performance hit.

Incidentally, there is a simpler fix: call dirstate.normallookup() on
every file updated by commit() at the end of the commit.  The trouble
with that solution is that it imposes a performance penalty on the
common case: it means the next status-dependent hg command after every
"hg commit" will be a little bit slower.  The patch here is more
complex, but only affects performance for the uncommon case.
2011-03-20 17:41:09 -04:00
Matt Mackall
ca9fdc1884 annotate: catch nonexistent files using match.bad callback (issue1590) 2011-03-19 01:34:49 -05:00
Matt Mackall
9bb3fa8c69 merge with stable 2011-03-17 17:08:13 -05:00
Miloš Hadžić
b3d3d7aa76 push/outgoing: print remote target path even if there's an error (issue2561)
This is a simple patch to make hg push/hg outgoing print their remote target
path even if the operation fails. I'm not sure if the original behavior was by
design.

This patch also changes one test to reflect the changed behaviour.
2011-03-17 22:55:02 +01:00
Patrick Mezard
ce258b1ae4 convert: add svnrev, svnpath and svnuuid template keywords
$ hg -R A-hg log --template '{rev} {svnuuid}{svnpath}@{svnrev}\n'
  10 644ede6c-2b81-4367-9dc8-d786514f2cde/trunk@10
2011-03-17 22:17:27 +01:00
Patrick Mezard
ef8d429854 transplant: add "transplanted" keyword
$ hg log --template '{rev} {transplanted}\n'
  7 a53251cdf717679d1907b289f991534be05c997a
2011-03-17 22:17:27 +01:00
Martin Geisler
ba5898d620 relink: avoid trying to lock the same repo twice 2011-03-16 15:34:10 +01:00
timeless
56241a1f0c templates: provide granularity for future values for age filter 2011-03-16 03:28:56 +01:00
Bernhard Leiner
baf797018e revset: report a parse error if a revset is not parsed completely (issue2654) 2011-03-16 23:09:14 +01:00
David Soria Parra
10510a0de1 bundle: update current bookmark to most recent revision on current branch
We check if the current bookmark is set to the first parent of the
dirstate. Is this the case we move the bookmark to most recent revision
on the current branch (where hg update will update you to).
2011-03-14 23:03:56 +01:00
David Soria Parra
848c5155b1 localrepo: do not update bookmarks in addchangegroup
We want to update the current bookmark to the most recent revision on
current branch unless there is a remote bookmark that points to
a different descendant. Addchangegroup is called before we can check for
remote bookmarks.

We don't update the bookmark in addchangegroup anymore to allow proper updating
of bookmarks in pull.
2011-03-14 20:53:55 +01:00
Radomir Dopieralski
30b72ca2fb rebase: add -m/--message to rebase --collapse (issue2389)
When collapsing changesets with rebase, you get a chance to edit the commit
message manually, but there is no way to pass this message from the command
line. This patch adds a `--message` (with short form `-m`) and `--logfile`
(with short form `-m`) options to the rebase command. These options suppresses
the generation of the default commit message, and instead use the message
provided in the option (in case of `-m`) or in the file it points to (in case
of `-l`).

If you use this option without the `--collapse` option, it will raise an
error.

Options documentation edited by Patrick Mezard <pmezard@gmail.com>
2011-03-15 18:33:36 +01:00
David Wolever
7bd158b865 Updating hgext.extdiff to use revsets 2011-03-15 17:50:02 -04:00
Martin Geisler
9b725c9bcb merge with stable 2011-03-16 16:07:06 +01:00
Martin Geisler
af8080dec2 relink: format reclaimed byte count nicely 2011-03-16 13:51:47 +01:00
Martin Geisler
48bef00c98 test-relink: remove unnecessary ui.username setting 2011-03-16 13:25:12 +01:00
David Soria Parra
2def9dba3a test-https: match output from b396ee1c907c 2011-03-16 09:05:59 +01:00