Commit Graph

2379 Commits

Author SHA1 Message Date
John Mulligan
8806103077 localrepo: remove 'closed' argument to heads(...) function
- repository heads are not associated with the closed attribute, so
remove it making the code in line with the concept.
- Fix functions that were calling heads with the parameter.
- Adjust webcommands.branches to include the concept of inactive
as well as open and closed branches
- Fix code and docstrings in commands to make the correct use of
closed branches & branch heads clearer
- Improve grammar of 'hg heads' help text (2nd submission)

this does not alter the cli for hg branches, that work is
still to be done
2009-06-10 19:11:49 -04:00
Adrian Buehlmann
d4fe84d762 mq: eliminate warning on qpush with empty series
Warning was "DeprecationWarning: use lock.release instead of del lock"
2009-06-08 20:02:44 +02:00
timeless
52c84115f8 Improve English for help text of many core hg commands.
co-author: Greg Ward <greg-hg@gerg.ca>
2009-06-09 21:51:34 -04:00
Patrick Mezard
278d305681 test-convert-svn-*: no longer need the url building code 2009-06-09 21:50:42 +02:00
timeless
3ceba44569 keyword: improve English 2009-06-09 09:25:34 -04:00
timeless
fb33de67af Generally replace "file name" with "filename" in help and comments. 2009-06-09 09:25:17 -04:00
Matt Mackall
1b05a52143 win32text: drop disabling portion of test
disabling extension leaves dirstate confused about whether affected
files are clean or not, not much point testing it.
2009-06-09 11:55:32 -05:00
Henrik Stuart
4ad17e2831 convert: better support for CVS branchpoints (issue1447)
This records the branches starting at individual CVS file revisions,
using the symbolic names map rather than just the branches
information.  This information is used to generate Mercurial
changesets. Despite the changes, the CVS conversion still suffers
heavily from cvsps' deficiencies in generating a correct
representation of the CVS repository history.
2009-06-09 08:59:49 +02:00
Matt Mackall
826dfe5eff merge: refactor manifestmerge init to better report effective ancestor 2009-06-08 18:14:44 -05:00
Matt Mackall
a9d2386a66 merge: combine a copy and move case 2009-06-08 18:14:44 -05:00
Matt Mackall
e7ff3ff5bc merge: allow merging going backwards
New behavior is generally superior and more correct, except possibly
with regards to missing files. hg up . is now effectively a no-op,
which is probably the desired behavior for people expecting to move to
tip, but may surprise people who were expecting deleted files to
reappear.

case 1: update to .

a-w -> a-w

classic: ancestor a
 missing     recreated     right?
 rmed        recreated     WRONG
 added       forgotten     WRONG
 changed     preserved     RIGHT
 conflicted  can't happen

backward merge: ancestor a  (NO EFFECT)
 missing     missing      wrong?
 rm'ed       rm'ed        RIGHT
 added       preserved	  RIGHT
 changed     preserved    RIGHT
 conflicted  can't happen

case 2: update to ancestor of .

a-b-w -> b-w
          \
           a

classic:  ancestor a
 missing       recreated        right?
 rmed          recreated        wrong?
 added         forgotten        wrong?
 changed       preserved        RIGHT
 conflicted    preserved        wrong?

backwards merge: ancestor b
 missing       missing or conflict  right?
 rm'ed         missing or conflict  right?
 changed       preserved            RIGHT
 conflicted    merge                RIGHT
 added         preserved            right?
2009-06-08 18:14:44 -05:00
Matt Mackall
da4ac4f699 merge: pretend ancestor is local to simplify backwards and overwrite 2009-06-08 18:14:44 -05:00
Brendan Cully
167122c387 Unbreak run-tests support for out-of-tree extensions 2009-06-06 15:38:03 -07:00
Will Maier
b6685f18df test-fncache: Use find instead of ls -R.
Different platforms implement -R differently (and it produces
unneccessarily verbose output in this case). find is just as
good and more consistent. Unbreaks test on OpenBSD.

Edited by pmezard: added 'sort' call
2009-06-04 18:11:11 -06:00
Will Maier
3cc4d8d3f2 Make test-verify SUSv3 compatible.
'head -c' isn't supported on (at least) OpenBSD and is not
part of SUSv3. Instead, use dd.

See also:

    http://www.opengroup.org/onlinepubs/009695399/utilities/head.html
2009-06-04 17:33:30 -06:00
Dirkjan Ochtman
176bc50a2d hgweb: allow distinction between open/closed branches on branches page 2009-06-04 18:05:50 +02:00
Matt Mackall
fcb44e87db commit: move explicit file checking into repo.commit 2009-06-01 21:51:00 -05:00
Matt Mackall
e12da484f7 mq: drop unneeded files args for commit 2009-06-01 13:51:21 -05:00
Dirkjan Ochtman
5912c48b40 tests: delete parallel coverage files after combining 2009-06-03 14:10:36 +02:00
John Mulligan
3f2923090d heads: show closed heads only when --closed is passed
Add a --closed (-c) option to 'hg heads' to show all heads and change the
default behavior to refrain from showing fully closed branches.

Enhance 'hg heads <branch>' so that:

* default: displays normal & inactive heads, not closed heads
* --closed: displays normal, inactive & closed heads
* --active: displays only normal heads
* both --closed and --active: displays normal & closed heads only
2009-06-03 13:59:38 +02:00
John Mulligan
e094244749 localrepo: set heads and branchheads to be closed=False by default
The heads(...) and branchheads(...) functions will now only return closed
heads when explicitly asked for them. This will cause 'hg merge' to have
better behavior in the presence of a branch that has closed heads when no
explicit rev is passed.
2009-06-03 13:42:55 +02:00
Patrick Mezard
a848b6f227 convert: rewrite tags when converting from hg to hg 2009-06-01 17:12:42 +02:00
Patrick Mezard
06e4a5967d convert: default revisions order depends on source
When converting Mercurial repositories you expect the revision numbers to be
preserved, while other sources conversions focus on efficiency.
2009-06-01 17:12:41 +02:00
Patrick Mezard
e8585b2da9 convert: fail fast if source does not support --sourcesort 2009-06-01 17:12:39 +02:00
Patrick Mezard
7c73a84f65 convert: add --sourcesort option for source specific sort
Only supported by Mercurial source for now.
2009-06-01 17:12:39 +02:00
Greg Ward
e8d6180038 run-tests: don't replace PYTHONPATH, just augment it.
(Needed at least for Subversion bindings on OS X, which are in
/opt/subversion.  Useful for other external libraries installed in
non-standard places too.)
2009-06-01 09:18:35 -04:00
Matt Mackall
e81e064b9c add: use match.bad callback more effectively 2009-05-31 17:54:18 -05:00
Greg Ward
3dc47b69c7 run-tests: redefine --with-hg so it takes the 'hg' script to run.
- in parseargs(), check that --with-hg value is valid
- add handy --local option for "--with-hg=../hg"
- ensure that we always set PATH and PYTHONPATH (not just
  when doing a temporary install)
- override any existing PYTHONPATH, so test success does not
  depend on whatever happens to be in the caller's environment
- give tests a little more control by exporting $PYTHON to the
  environment; needed by test-convert and test-mergetool when
  they run hg with a stripped-down $PATH

Also, add a big comment explaining all the corner cases to test for the
next person who tries to modify this script.
2009-05-31 15:20:31 -04:00
Greg Ward
2cb745bb8b run-tests: fix _checkhglib() so it's correct when using --with-hg.
Since this makes the warning less likely, upgrade it to a "real"
warning to stderr.
2009-05-29 22:18:16 -04:00
Greg Ward
47093c6314 run-tests: factor out _checkhglib() to check import path of 'mercurial'.
- rename _hgpath() to _gethgpath() and move it down next to _checkhglib()
- change _gethgpath() so it caches its result: replaces global 'hgpkg'
  that anyone can use with global '_hgpath' that is only for _gethgpath()
- no need to pass 'expecthg' to runchildren() or runtests() anymore

Also: do not change global PYTHON when doing coverage; this seems to
be unnecessary, since we create a dummy 'hg' script that handles
coverage for us, and it made things brittle.  (E.g. the rest of this
patch makes the call to _hgpath() come later, and it was broken by
enabling coverage.)
2009-05-29 22:18:15 -04:00
Greg Ward
3c6e4e3061 run-tests: show PID if running in parallel mode with -v.
(Extremely handy when you break parallel operation and need to figure
out what's going on.  The assumption is that if you run with -v, you
want more details.)
2009-05-29 22:17:53 -04:00
Martin Geisler
5a71040932 commands: typo in bundle abort message
This error trigger if one calls bundle with the wrong parameters and
it is thus not an error scripts will want to look for (they could and
should ensure that they call bundle with the correct parameters).
2009-05-31 18:09:19 +02:00
Martin Geisler
c624e91552 fixed typos found in translatable strings
This is from a spell-check of hg.pot.
2009-05-31 14:55:51 +02:00
Martin Geisler
37b00fb404 test-hybridencode: break long string literals 2009-05-31 01:13:45 +02:00
Martin Geisler
cac71647b1 posix: do not use fstat in isowner
The fstat function was undefined, but never used since a stat object
was always passed in the optional st argument. Passing st is now
mandatory.

This bug crept in when util was split up into posix and windows
modules. The fstat function is still defined in util, but importing it
into posix would create an import cycle which seems unnecessary.
2009-05-30 23:42:35 +02:00
Martin Geisler
58e8fb6277 removed unused imports 2009-05-30 23:20:30 +02:00
Brendan Cully
5189b36798 Move alias into core 2009-05-30 11:32:23 -07:00
Greg Ward
4ad6973308 run-tests: clarify timeout log message. 2009-05-29 10:00:03 -04:00
Cédric Duval
09fe588f0d tests: test for dispatch on [defaults]: more clearly differing output
Using '-r null' instead of '-v' as the overriden command default.
The latter did not have any effect on output, thus not giving much
indication on whether the modified defaults were really in use or not.
2009-05-24 22:15:48 +02:00
Peter Arrenbrecht
38e7748fe0 revlog: add test for 96029cc19930 (issue1678) 2009-05-27 14:11:41 +02:00
Benoit Boissinot
d81f680b31 store encoding: .i/.d encoding for non-store repo (broken by 67e6074ba430) 2009-05-26 23:49:53 +02:00
Dirkjan Ochtman
f9911763f7 tests: make coverage run in parallel mode, clean up coverage code 2009-05-25 18:34:35 +02:00
Patrick Mezard
64fcf86ad8 convert: better feedback when filtering out empty revisions
Original patch by Herbert Griebel <herbertg@gmx.at>
2009-05-24 18:30:59 +02:00
Benoit Boissinot
9ad2c4fd5b merge with crew 2009-05-24 16:33:22 +02:00
Patrick Mezard
82ffe82eb9 convert: deprecate external cvsps, to be removed in 1.4 2009-05-24 16:27:56 +02:00
Simon Heimberg
293c5101a0 runtest: do not start testing when there is no test 2009-05-19 09:36:20 +02:00
Sune Foldager
13556c33e2 tests: add tests for new pre-push logic (issue736)
Co-contributor: Henrik Stuart <henrik.stuart@edlund.dk>
2009-05-23 17:04:41 +02:00
Sune Foldager
2161b139a6 named branches: improve pre-push logic (issue736)
Each named branch is considered separately, and the push is allowed if
no new branch heads are created for any named branch to be pushed.

Due to some tests's use of --debug, their output will change after this
addition. This has been fixed as well.

Co-contributor: Henrik Stuart <henrik.stuart@edlund.dk>
2009-05-23 17:04:31 +02:00
Henrik Stuart
e3379206dc named branches: server branchmap wire protocol support (issue736)
The repository command, 'branchmap', returns a dictionary, branchname
-> [branchheads], and will be implemented for localrepo, httprepo and
sshrepo.

The following wire format is used for returning data:

branchname1 branch1head2 branch1head2 ...
branchname2 ...
...

Branch names are URL encoded to escape white space, and branch heads
are sent as hex encoded node ids. All branches and all their heads are
sent.

The background and motivation for this command is the desire for a
richer named branch semantics when pushing changesets. The details are
explained in the original proposal which is included below.


1. BACKGROUND

The algorithm currently implemented in Mercurial only considers the
graph theoretical heads when determining whether new heads are
created, rather than using the branch heads as a count (the algorithm
considers a branch head effectively closed when it is merged into
another branch or a new named branch is started from that point
onward).

Our particular problem with the algorithm is that we'd like to see the
following case working without forcing a push:

Upsteam has:

(0:dev) ---- (1:dev)
\
 `--- (2:stable)

Someone merges stable into dev:

(0:dev) ---- (1:dev) ------(3:dev)
\                         /
 `--- (2:stable) --------´

This can be pushed without --force (as it should).
Now someone else does some coding on stable (a bug fix, say):

(0:dev) ---- (1:dev) ------(3:dev)
\                          /
 `--- (2:stable) ---------´---------(4:stable)

This time we need --force to push.

We allow this to be pushed without using --force by getting all the
remote branch heads (by extending the wire protocol with a new
function).

We would, furthermore, also prefer if it is impossible to push a new
branch without --force (or a later --newbranch option so --force isn't
shoe-horned into too many disparate functions, if need be), except of
course in the case where the remote repository is empty.

This is what our patches accomplish.


2. ALTERNATIVES

We have, of course, considered some alternatives to reconstructing
enough information to decide whether we are creating new remote branch
heads, before we added the new wire protocol command.

2.1. LOOKUP ON REMOTE

The main alternative is to use the information from remote.heads() and
remote.lookup() to try to reconstruct enough graph information to
decide whether we are creating new heads. This is not adequate as
illustrated below.

Remember that each lookup is typically a request-response pair over
SSH or HTTP(S).

If we have a simple repository at the remote end like this:

(0:dev) ---- (1:dev) ---- (3:stable)
\
 `--- (2:dev)

then remote.heads() will yield [2, 3]. Assume we have nodes [0, 1, 2]
locally and want to create a new node, 4:dev, as a descendant from
(1:dev), which should be OK as 1:dev is a branch head.

If we do remote.lookup('dev') we will get [2]. Thus, we can get
information about whether a branch exists on the remote server or not,
but this does not solve our problem of figuring out whether we are
creating new heads or not.

Pushing 4:dev ought to be OK, since after the push, we still only have
two heads on branch a.

Using remote.lookup() and remote.heads() is thus not adequate to
consistently decide whether we are creating new remote heads (e.g. in
this situation the latter would never return 1:dev).

2.2. USING INCOMING TO RECONSTRUCT THE GRAPH

An alternative would be to use information equivalent to hg incoming
to get the full remote graph in addition to the local graph.

To do this, we would have to get a changegroup(subset) bundle
representing the remote end (which may be a substantial amount of
data), getting the branch heads from an instantiated bundlerepository,
deleting the bundle, and finally, we can compute the prepush logic.

While this is backwards compatible, it will cause a possibly
substantial slowdown of the push command as it first needs to pull in
all changes.


3. FURTHER ARGUMENTS IN FAVOUR OF THE BRANCHMAP WIRE-PROTOCOL EXTENSION

Currently, the commands incoming and pull, work based on the tip of a
given branch if used with "-r branchname", making it hard to get all
revisions of a certain branch only (if it has multiple heads). This
can be solved by requesting the remote's branchheads and letting the
revisions to be used with the command be these heads. This can be done
by extending the commands with a new option, e.g.:

hg pull -b branchname

which will be turned into the equivalent of:

hg pull -r branchhead1 -r branchhead2 -r branchhead3

We have a simple follow-up patch that can do this ready as well
(although not submitted yet as it is pending the acceptance of the
branch patch).


4. WRAP-UP

We generally find that the branchmap wire protocol extension can
provide better named branch support to Mercurial. Currently, some
things, like the initial push scenario in this mail, are fairly
counter-intuitive, and the more often you have to force push, the more
it is likely you will get a lot of spurious and unnecessary merge
nodes. Also, restricting incoming and pull to all changes on a branch
rather than changes on the tip-most head would be a sensible extension
to making named branches a first class citizen in Mercurial.
Currently, named branches sometimes feel like a late-coming unwanted
step-child.

We have run it in a production environment for a while, with fewer
multiple heads occurring in our repositories and fewer confused users
as a result.

Also, it fixes the long-standing issue 736.

Co-contributor: Sune Foldager <cryo@cyanite.org>
2009-05-23 17:02:49 +02:00
Nicolas Dumazet
21b374a449 inotify: introduce debuginotify, which lists which paths are under watch 2009-04-22 00:37:35 +09:00