Commit Graph

2641 Commits

Author SHA1 Message Date
David Champion
08998d553f Bourne shells do not maintain $PWD; update tests accordingly 2009-07-07 01:25:44 +02:00
Brodie Rao
930e73d10f tests: remove more instances of export FOO=bar bashism 2009-07-05 18:52:55 -04:00
Matt Mackall
fc2733b540 commit: lose some pointless 'nothing changed' messages
Move message from localrepo to commands. This drops confusing messages
in subrepo, import, and rebase.
2009-07-01 01:16:19 -05:00
Matt Mackall
a87df088a6 branches: add --closed flag for consistency with heads 2009-07-01 00:31:59 -05:00
Matt Mackall
0210a48141 addremove: build lists of already added and removed files too (issue1696) 2009-06-30 23:25:53 -05:00
Nicolas Dumazet
dcf8dc04b3 patchbomb: add --flag to put flags in subject prefixes
--flag foo uses:
  [PATCH foo]
or
  [PATCH M of N foo]
depending on the number of patches.

Multiple flags are supported: --flag foo --flag bar gives [PATCH foo bar]
2009-07-15 11:26:47 +09:00
Yann E. MORIN
b58fccf06d mq: add the date with qrefresh, even if missing (issue1768)
When setting the date with qrefresh (-d|-D), and the patch does have
neither a 'Date:' nor a '# Date' header, add the date field as such:

- if the patch has a 'From:' header, add a 'Date:' header
- otherwise, upgrade to Mercurial extended patch format and add '# Date'
2009-08-12 10:57:27 +02:00
Yann E. MORIN
ac0ee93ebf mq: upgrade the patch to HG format when adding the author name with qrefresh
When setting the author field with qrefresh (-u|-U), and the patch does have
neither a 'From:' nor a '# User' header, add the author name as such:

- if the patch has a 'Date:' header, add a 'From:' header
- otherwise, upgrade to Mercurial extended patch format and add # From
2009-08-12 10:48:18 +02:00
Simon Heimberg
8cd1935907 test-clone-failure: reenable perm to allow deletion 2009-08-07 21:15:01 +02:00
Brendan Cully
dcdbd19aef patch: create file even if source is not /dev/null
as long as the first hunk is -0,0 and the source and destination have the
same name. Matt found a patch like this, and /usr/bin/patch accepts it.
2009-08-07 19:27:54 -07:00
Bryan O'Sullivan
91929f684f Fix failing darcs test 2009-08-06 21:35:25 -07:00
Brendan Cully
66c5eca92f Merge backout of 57179258e7fe 2009-08-05 22:52:35 -07:00
Brendan Cully
7686b9a0e9 Backed out changeset 57179258e7fe.
On OS X, it broke test-issue322, test-issue660, test-permissions,
test-symlink-addremove, and test-walk.
2009-08-05 22:51:30 -07:00
Brendan Cully
934b96bb88 churn: correct output when run in subdirectories 2009-08-05 17:17:06 -07:00
Christian Ebert
00ff1e7846 keyword: remove "help keyword" from test
Testing help output does not make sense as we have no way to
check for errors in content which would be the only reasonable
test here.
2009-08-05 17:20:47 +02:00
Martin Geisler
4986571bd9 help: use field lists for lists of extensions 2009-08-03 00:01:50 +02:00
Martin Geisler
d2c1c263b4 minirst: parse field lists 2009-08-02 23:38:07 +02:00
Martin Geisler
65b64640d1 minirst: indent literal blocks with two spaces
The vast majority* of them are formatted like this in the source, so
this basically reverts the output to how it looked before we got the
minirst parser.

*: the help on templating use four spaces for some examples and will
   now shown with an indentation of just two spaces.
2009-08-02 17:17:17 +02:00
Martin Geisler
d1c63312f6 Merge with crew-stable 2009-08-01 00:36:22 +02:00
Martin Geisler
b159060278 Merge with crew-stable 2009-07-29 22:23:14 +02:00
Matt Mackall
eba820848f Merge with crew 2009-07-27 18:38:20 -05:00
Dan Villiom Podlaski Christiansen
46be30bb99 dirstate: fold paths using the just added util.realpath() function.
Using the one true canonical path of a directory entry allows
equivalent paths to be treated gracefully. Equivalent means, in this
case, differing directory entries resulting in the same, unique file
system link to a file.
2009-07-26 18:02:06 +02:00
Dirkjan Ochtman
da9d2d8f2b merge with crew-stable 2009-07-23 20:44:26 +02:00
Bryan O'Sullivan
2f16501cf7 Merge with crew-stable 2009-07-22 15:28:30 -07:00
Benoit Boissinot
6018085a10 merge with -stable 2009-07-19 21:15:40 +02:00
Patrick Mezard
5b2d10b6fe Merge with crew-stable 2009-07-19 18:28:43 +02:00
Matt Mackall
5cf070ede1 Merge with crew 2009-07-18 12:41:49 -05:00
Matt Mackall
d8c1b12a59 changelog: move delayopener outside of class to eliminate reference cycle 2009-07-18 12:34:38 -05:00
Brendan Cully
09920a4acd Merge with hg 2009-07-16 21:05:24 -07:00
Martin Geisler
3951831e0b commands: use minirst parser when displaying help 2009-07-16 23:25:26 +02:00
Martin Geisler
7953ecf0bd minimal reStructuredText parser 2009-07-16 23:25:25 +02:00
Greg Ward
da8b780a58 tags: support 'instant' tag retrieval (issue548)
- modify _readtagcache() and _writetagcache() to read/write tag->node
  mapping for global tags
- if (and only if) tip unchanged, use that cached mapping to avoid
  reading any revisions of .hgtags
- change so tag names are UTF-8 in memory in tags.py, and converted to
  local encoding as late as possible (in localrepository._findtags())
2009-07-16 10:41:19 -04:00
Greg Ward
81e6782a86 tags: implement persistent tag caching (issue548).
- rename findglobaltags() to findglobaltags1() (so the "no cache"
  implementation is still there if we need it)
- add findglobaltags2() and make findglobaltags() an alias for it
  (disabling tag caching is a one-line patch)
- factor out tagcache class with methods readcache() and writecache();
  the expensive part of tag finding (iterate over heads and find
  .hgtags filenode) is now in tagcache.readcache()
2009-07-16 10:39:42 -04:00
Greg Ward
2b8c820086 test-tags: enhance the test to probe tag caching better (issue548).
- give detailed dumps of .hgtags and localtags content
- repeat some query operations to expose cache bugs
- ensure that rollback/strip undo tagging operations
2009-07-16 10:39:41 -04:00
Greg Ward
da88b2b09f test-tags: clarify test output; simplify test script a bit (issue548).
- use simpler way ('hg id') to get current changeset id
- add 'echo' statements to guide the eye when reading output
- add some more output to clarify the state of .hgtags
- drop '-d' option from every commit/tag, since run-tests.py
  does this (although with a different timestamp, so changeset
  ids differ)
2009-07-16 10:39:41 -04:00
Martin Geisler
a2bda0adf6 merge with crew-stable 2009-07-15 17:44:47 +02:00
Benoit Boissinot
05983b6745 merge with -stable 2009-07-14 20:24:16 +02:00
Nicolas Dumazet
5335f5c399 inotify: server: explicitely ignore events in subdirs of .hg/ (issue1735) 2009-07-13 21:55:17 +09:00
Nicolas Dumazet
2645ee079e inotify: fix issue1375, add a test.
The biggest problem was the data structure, which did not allow changing
a file into a directory or vice versa. This problem is fixed by 47d29dcb7266.

The walk() method also had an issue in this case:
 - we know 'path' as a directory. inotify server sleeps.
 - 'path' is deleted
 - 'path' is recreated as a file
 - the server catches up here, and see the deletion. it instantiates a scan(),
   which in its turn calls for walk(repo, path).
 - walk() then assumes that 'path' is a directory and calls os.listdir on it,
   which raises an OSError(errno.ENOTDIR)

Catch the error, and yield the file instead of the directory contents.
2009-07-13 16:49:05 +02:00
Mads Kiilerich
b3ac6d2456 mq: qpop now tells which patches are popped
When navigating through a patch series by qpushing and qpopping it was easy to
get lost because qpop was silent. I found myself often running qnext after qpop
to see which patch I just dropped - especially if I was about to qrm it. This
patch makes qpop more symmetric to qpush by showing which patches are
applied/"unapplied".

I think it is a good change even though it changes output by adding a new line
of output.
2009-07-09 23:59:03 +02:00
Martin Geisler
264a5c5ff5 keyword: use all caps for 'note:' in help string
The diff, export, log, and status commands write it as 'NOTE:'.
2009-07-09 22:52:39 +02:00
Martin Geisler
82d550f2c0 notify: fix indentation in module docstring 2009-07-09 22:43:24 +02:00
Martin Geisler
c5357392bb notify: cleanup module docstring 2009-07-09 22:42:43 +02:00
Martin Geisler
bd5efe5737 convert: fix inconsistent indentation in help text
The sort modes flags and convert.cvsps options were indented while the
convert.hg, convert.svn, and convert.p4 options were not. I've now
un-indented all of them.
2009-07-09 20:15:15 +02:00
Matt Mackall
eb6cba34d7 Merge with stable 2009-07-09 19:49:02 -05:00
Martin Geisler
c2c41ac679 convert: fixed typo in docstring 2009-07-08 23:12:40 +02:00
Martin Geisler
4709362b0c record: wrapped docstrings at 78 characters 2009-07-07 23:54:42 +02:00
Martin Geisler
165ad8475f rebase: wrapped docstrings at 78 characters 2009-07-07 23:54:42 +02:00
Martin Geisler
06ba3dfad7 notify: wrapped docstrings at 78 characters 2009-07-07 23:54:42 +02:00
Martin Geisler
3571ef287c mq: wrapped docstrings at 78 characters 2009-07-07 23:54:42 +02:00
Martin Geisler
04658a9b97 keyword: wrapped docstrings at 78 characters 2009-07-07 23:54:42 +02:00
Martin Geisler
e4a37ea58a convert: wrapped docstrings at 78 characters 2009-07-07 23:54:42 +02:00
Martin Geisler
a53360d76e commands: wrapped docstrings at 78 characters
We have always had a left margin of 4 characters -- probably just
because that's how docstrings for top-level functions turn out by
default, but it also looks nice in the built-in help.

The docstrings were wrapped at 70 characters, which is the default for
Emacs. However, this gives a right margin of 10 characters in a
standard 80 character terminal.

I've now wrapped the relevant docstrings at 78 characters, effectively
killing the right margin. The asymmetric margins looked a bit odd and
some of the text looked cramped with a right margin, so Dirkjan and I
felt that it was best to remove it entirely. The two character gap was
kept to have some space between the border of the terminal -- it will
also make diffs involving the docstrings fit in a 80 character line.
2009-07-07 23:54:30 +02:00
Martin Geisler
be9e1c997f extdiff: fix indentation and use gettext 2009-07-07 23:30:48 +02:00
Cédric Duval
8eebee2964 patchbomb: use local time for the Date: header 2009-07-05 17:09:01 +02:00
Cédric Duval
5287eb35fe patchbomb: fix From_ in the message's envelope
Localized date in the From_ prevents MUAs like mutt from parsing mbox files
generated by patchbomb. Using a 24 characters date in asctime format instead.
2009-07-05 16:42:10 +02:00
Martin Geisler
dafda53dbe merge with crew-stable 2009-07-07 14:20:58 +02:00
Brodie Rao
c8364c2177 tests: remove more instances of export FOO=bar bashism 2009-07-05 18:52:55 -04:00
David Champion
e2549fcce0 test-gpg: suppress secure memory warning
Some platforms (Solaris for one) does not support secure memory and
would give a warning.
2009-07-05 13:59:25 -05:00
David Champion
260ae3b5d7 test: fix for compatibilty with true Bourne /bin/sh
'export foo=bar' is an extension, replaced with 'foo=bar; export foo'
2009-07-05 13:58:37 -05:00
Alejandro Santos
77d606ac51 compat: use open() instead of file() everywhere 2009-07-05 11:01:30 +02:00
Alejandro Santos
c0dcbaabfe tests: add -3 switch to run-tests.py 2009-07-05 10:59:54 +02:00
Henri Wiechers
712ac310c2 test python hook configured with python:[file]:[hook] syntax
Adds a test for python hooks configured with python:[file]:[hook] syntax
in .hgrc. Increases the test coverage for mercurial/hook from 92% (79/85)
to 96% (82/85).
2009-06-26 14:42:05 +02:00
Brendan Cully
119683eac8 Merge with crew 2009-06-29 09:00:37 -07:00
Brendan Cully
742dbdb1e3 Update test output for 084c96645721 2009-06-29 09:00:26 -07:00
Brendan Cully
e55703261f Branch heads should not include "heads" that are ancestors of other heads.
For example, given 1 (branch a) -> 2 (branch b) -> 3 (branch a)
I expect "hg heads a" to show only 3.
Discovered by running hg heads HEAD on the mutt repo, where older clients
committed default on top of HEAD.
2009-06-29 00:54:23 -07:00
Christian Ebert
1ac1590504 keyword: improve help for kwfiles
- just use "files" instead of "filenames" (analogous to "hg status -h")
- reference the extension help wrt pattern configuration

Kudos to timeless for helpful suggestions.
2009-06-28 16:23:23 +02:00
Christian Ebert
4a2d871161 keyword: improve help for kwfiles 2009-06-27 13:05:25 +02:00
Greg Ward
e4e711f7e0 color: don't blow up if configured with unknown color (just warn). 2009-06-25 09:23:33 -04:00
Greg Ward
e0eb715075 run-tests: use os.path.realpath() to find hg's setup.py.
Needed for running out-of-tree test suites without --with-hg/--local.
2009-06-23 22:20:54 -04:00
Mads Kiilerich
4f97bc02c9 ui.prompt: Show prompt and selection in non-interactive mode
ui.prompt was completely silent in non-interactive mode, unless in verbose
mode. It is fine that it chooses the default automatically, but it is confusing
that the message and prompt shown interactively can't be found in scripted
tests.

The prompt and selection is now .write'ed instead of .note'ed.
2009-06-21 03:13:38 +02:00
Martin Geisler
1454ed1684 commands: wrap short descriptions in 'hg help'
The code for wrapping a single line of text with a hanging indent was
duplicated in commands and help -- it's now moved to a new function
called wrap in util.

The function defaults to a line width is 78 chars, and this un-wraps
some command line flag descriptions, hence the test output changes.
2009-06-24 19:15:58 +02:00
Dirkjan Ochtman
1d29e68744 change wiki/bts URLs to point to new hostname 2009-06-24 15:32:37 +02:00
Dirkjan Ochtman
c8e6583765 extensions: change descriptions for hook-providing extensions
Thanks to timeless and Dave Townsend for advice!
2009-06-24 13:42:34 +02:00
Dirkjan Ochtman
1c6c4a9bc7 extensions: fix up description lines some more 2009-06-24 12:25:56 +02:00
Martin Geisler
4323e41d7e test-globalopts: broken by output change in 9635d54be8c2 2009-06-23 23:05:51 +02:00
Fred Wulff
affad77f81 Add (pre)outgoing hooks for local clones. 2009-04-17 16:34:43 -07:00
Steve Losh
7220dda224 Add a forget command for easily untracking files.
This command does exactly what 'hg remove -Af [FILES]' does.

The reason for creating a new command is that the options for 'hg remove'
are confusing (-A removes only deleted files, -f forces deletion, and using
both means *the exact opposite of both*).

[mpm: simplified help text, code, and updated tests]
2009-05-31 03:09:00 -04:00
Mads Kiilerich
677dbc5997 test merge-tools internal:dump and internal:prompt 2009-06-21 03:11:52 +02:00
Martin Geisler
422e30f7db test-grep: fixed comment 2009-06-23 14:41:16 +02:00
Cédric Duval
dbcec5595d extensions: improve the consistency of synopses
Trying as much as possible to consistently:
 - use a present tense predicate followed by a direct object
 - verb referring directly to the functionality provided
   (ie. not "add command that does this" but simple "do that")
 - keep simple and to the point, leaving details for the long help
   (width is tight, possibly even more so for translations)

Thanks to timeless, Martin Geisler, Rafael Villar Burke, Dan Villiom
Podlaski Christiansen and others for the helpful suggestions.
2009-06-22 15:48:08 +02:00
Patrick Mezard
64f9f43970 convert/svn: test svn tags encoding 2009-06-21 23:17:05 +02:00
Patrick Mezard
55cbeb1d9a convert/svn: stop returning unicode revision identifiers 2009-06-21 23:17:02 +02:00
Patrick Mezard
872c1fc1ec convert/svn: remove dead code from entry deletion code path
It was made obsolete when multi-branches commit were split into multiple
Mercurial commits.
2009-06-21 23:04:02 +02:00
Patrick Mezard
5943f46c36 convert/svn: remove useless encoding/decoding calls (issue1676) 2009-06-21 23:04:02 +02:00
Dirkjan Ochtman
9685cd7ac9 mq: fix error message for qpush inexistent-patch (issue1702) 2009-06-21 17:34:33 +02:00
Cédric Duval
06cac940ef help: adding a new help topic about extensions
Currently listing non-enabled extensions and a short introductory text.

Thanks to Dan Villiom Podlaski Christiansen for the preliminary
proof-of-concept code for listing available extensions.
2009-06-20 20:55:43 +02:00
Matt Mackall
689cdd2284 tags: silence warning about unknown tags
This is mostly a nuisance and can happen legitimately with pull -r, etc.
2009-06-20 10:53:47 -05:00
Matt Mackall
1ca56aef1e update: add --check option 2009-06-20 08:29:41 -05:00
FUJIWARA Katsunori
0c065c08fa compare grep result between target and its parent
I found that typical case is that grep target is added at (*) revision
in the tree shown below.

     +--- 1(*) --- 3
     0
     +--- 2 ------ 4

Now, I expect 'hg grep --all' to show only rev:1 which is first
appearance of target line.

But 'hg grep --all' will tell:

  target line dis-appeared at 3 => 4
  target line     appeared at 2 => 3
  target line dis-appeared at 1 => 2
  target line     appeared at 0 => 1

because current 'hg grep' implementation compares not between target
revision and its parent, but between neighbor revisions in walkthrough
order.

I checked performance of this patch by "hg grep --follow --all
walkchangerevs" on whole Mercurial repo, and patched version could
complete as fast as un-patched one.
2009-05-19 16:49:54 +09:00
Dirkjan Ochtman
73679ffc0d tests: fix test for convert detection of p4 repos 2009-06-19 14:00:41 +02:00
Dirkjan Ochtman
605b944edf kill trailing whitespace 2009-06-19 13:47:50 +02:00
Dirkjan Ochtman
7daf0cc9cd merge: rename -S/--show option to -P/--preview 2009-06-19 13:58:48 +02:00
Dirkjan Ochtman
12ed4dc982 mq: unify code for qdel -r and qfin 2009-06-19 13:58:22 +02:00
Dirkjan Ochtman
d6eb9e3f55 mq: warn about finalizing patches without cset message 2009-06-19 12:37:29 +02:00
Frank Kingswood
d0ec83933c convert: Make P4 conversion cope with keywords, binary files and symbolic links.
Convert now handles errors from p4 during conversion more gracefully.
If keyword expansion is enabled in a P4 file then keywords will be
unexpanded in hg.
Added testcase for p4 filetypes and keyword (un)expansion.
This testcase ignores UTF and Apple files to avoid binary data.

Edited by pmezard: fixed collation issue on OSX
2009-06-18 10:39:04 +01:00
Martin Geisler
0dfb08009d patchbomb: update test output to match 51f46ab5ceb5 2009-06-18 15:04:20 +02:00
Christian Ebert
623f4a4a00 keyword: concise help title 2009-06-18 01:21:26 +01:00
Greg Ward
7ad75fed52 Fix test-convert-cvsnt-mergepoints so it works reliably.
Specifically, always run 'cvs commit' with -f option to force commit;
add one strategic sleep which seems to be necessary for post-merge
clobber-and-commit (-f doesn't force a commit there?).
2009-06-15 20:35:19 -04:00
Greg Ward
2b10164cb6 test-convert-cvsnt-mergepoints: make it work on OS X.
- don't create file 'cvs' where directory 'CVS' already exists
2009-06-15 20:35:19 -04:00
Greg Ward
357a69bec3 test-convert-cvsnt-mergepoints: ignore differences between CVS 1.11 and 1.12.
- factor out cvsci function (similar to other test-convert-cvs* scripts)
- add filterpath function (also similar to other scripts)
- generally munge the output of CVS
- add lots of output to make it easier to follow when things go wrong

This doesn't make the test pass reliably under CVS 1.11; it just makes
it behave the same as under CVS 1.12, i.e. sometimes it passes and
sometimes it fails.  Failure is more frequent with faster hardware.
2009-06-15 20:35:19 -04:00
Greg Ward
bc8b9b1849 Rename CVSNT "mergepoints" test and make it executable.
- rename test-convert-cvs-builtincvsps-cvsnt-mergepoints
  (and related files) to test-convert-cvsnt-mergepoints
- this ensures that the test will be run, but does NOT make
  it pass: in particularly, it fails regularly for me due
  to the inconsistent behaviour of CVS itself
- expect "Branchpoints:" in debugcvsps output
2009-06-15 20:35:19 -04:00
Colin Caughie
53aca7b1bf Fixed patch.eol bug that truncated all patched lines to one character
Also updated the import-eol test to test with lines longer than one character,
and also empty lines.
2009-06-16 16:22:42 +01:00
Matt Mackall
5870ebfbb8 subrepo: add a test 2009-06-15 02:51:10 -05:00
Matt Mackall
ce2e49a0da subrepo: introduce basic state parsing 2009-06-15 02:45:38 -05:00
Patrick Mezard
7039de96dc Make mq, record and transplant honor patch.eol 2009-06-15 00:03:27 +02:00
Patrick Mezard
c1548a6a3e Add patch.eol to ignore EOLs when patching (issue1019)
The intent is to fix many issues involving patching when win32ext is enabled.
With win32ext, the working directory and repository files EOLs are not the same
which means that patches made on a non-win32ext host do not apply cleanly
because of EOLs discrepancies. A theorically correct approach would be
transform either the patched file or the patch content with the
encoding/decoding filters used by win32ext. This solution is tricky to
implement and invasive, instead we prefer to address the win32ext case, by
offering a way to ignore input EOLs when patching and rewriting them when
saving the patched result.
2009-06-15 00:03:26 +02:00
Brendan Cully
09380f981f gpg: add test 2009-06-14 13:32:19 -07:00
Matt Mackall
6d110ab62c Merge with crew 2009-06-13 18:08:51 -05:00
Patrick Mezard
3ce6a90f5f bisect: improve --command output
- Display tested revisions without --verbose
- Display revision number
2009-06-13 23:02:51 +02:00
Patrick Mezard
db9db15698 test-bisect: test --command option 2009-06-13 22:42:15 +02:00
Patrick Mezard
c30fe9a6df bisect: fix traceback when command executable is not found 2009-06-13 22:42:13 +02:00
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
Steve Borho
2cd8aa240a merge: give hint as to how to discover uncommitted changes
Many users will try 'hg diff' here, and it will not show them missing files.
2009-05-22 11:42:21 -05:00
Patrick Mezard
75d91d6ef2 test-merge-tools: windows fixes
- /bin/cat does not exist, expect 'cat'
- non-interactive mode is not correctly detected in pysh, force it
2009-05-21 22:43:38 +02:00
Benoit Boissinot
58c694795e remove: warn if unversionned files are specified (issue1454) 2009-05-20 21:16:04 +02:00
Benoit Boissinot
5b1d4a56ec filelog encoding: move the encoding/decoding into store
the escaping of directories ending with .i or .d doesn't
really belong to filelog.

we put the encoding/decoding in store instead, for backwards
compat, streamclone and the fncache file format still uses the
partially encoded filenames.
2009-05-20 18:35:47 +02:00
Jeremy Whitlock
c090150d2d hgweb: make hgwebdir handle dict/list paths the same as config paths
Before this patch, the only way to get hgwebdir to honor the recursive paths
was to create a config object or a config file with the recursive paths in it.
This patch makes hgwebdir treat paths the same whether passed in as a list,
tuple, config or however hgwebdir supports passing paths.
2009-05-20 16:04:37 +02:00
Martin Geisler
92a59fc839 tests: replace #...# syntax with {...} 2009-05-19 23:02:17 +02:00
Dirkjan Ochtman
d99b64b14b patchbomb: don't localize Date headers 2009-05-19 15:10:45 +02:00
Benoit Boissinot
aa464dbde5 alias: e916ee90bfbd did not correctly handle whitespace in the args 2009-05-19 14:14:07 +02:00
Benoit Boissinot
fc43ae9519 update --clean: do not unlink added files (issue575) 2009-05-19 03:59:58 +02:00
Cédric Duval
781163e886 patchbomb: with --in-reply-to, still thread message under first in series
When specifying --in-reply-to for a message M, have
  [M]
    [0/2]
      [1/2]
      [2/2]

instead of
  [M]
    [0/2]
    [1/2]
    [2/2]

which is more consistent with the way messages are being threaded
when --in-reply-to is not used.
2009-05-19 01:37:38 +02:00
Martin Geisler
5571c196f3 merge with mpm 2009-05-19 01:17:54 +02:00
Matt Mackall
16d4ef56bc commit: explain how to abort commit in editor 2009-05-18 17:36:24 -05:00
Matt Mackall
89cb6de980 commit: move editor outside transaction
The commit editor is now invoked before files and manifest are
committed. The editor is now run with only the wlock held and aborting
an edit no longer requires rolling back a transaction. Changes to
files during a commit still result in undefined behavior.

(This is preliminary work for committing subrepositories)
2009-05-18 17:36:24 -05:00
Martin Geisler
ecadaada56 spartan: ensure equal heights for file and annotate views
The display used to jump up and down when switching from the file view
to the annotate view. It now stays still: when switching from the file
view to the annotate view it looks like the file content is simply
right-shifted to make room for the author names.
2009-05-19 00:28:47 +02:00
Martin Geisler
301bf629e6 spartan: simplify CSS colors (#xxxxxx -> #xxx) 2009-05-18 23:35:27 +02:00
Martin Geisler
12caf17e05 coal/paper/spartan: remove extra line break in annotate view 2009-05-18 23:27:51 +02:00
Benoit Boissinot
6743bf50c5 merge with crew 2009-05-17 23:07:23 +02:00
Martin Geisler
3952bb3de2 coal, paper: add newlines when displaying a file in hgweb
The newlines make the HTML somewhat readable and gives much smaller,
readable diffs when the tests change.
2009-05-17 22:51:50 +02:00
Benoit Boissinot
bee6cb3d55 addremove/findrenames: find renames according to the match object (issue1527)
Instead of only finding similarities in the added/removed files found
by the addremove step, follow the match object:

hg addremove -s80 foo -> add and removes files in foo
                         + find similarities between files in foo
hg addremove -s80 -> add and removes files in the whole repo
                     + find similarities between files in the whole repo

hg import --similarity will still work correctly (only find similarities
between files found in the patch).
2009-05-17 22:51:17 +02:00
Martin Geisler
f51ce71d96 test-highlight: decouple test from get-with-headers.py
The test copied get-with-headers.py from $TESTDIR and committed it to
a test repository. The test output therefore depended unnecessarily on
the exact content of get-with-headers.py. It has now been replaced
with another small Python script.
2009-05-17 21:47:24 +02:00
Patrick Mezard
e76a7010bb Merge with crew-stable 2009-05-17 20:00:11 +02:00
Patrick Mezard
3e92f126a2 Add tests for qfold 2009-05-17 19:54:26 +02:00
Benoit Boissinot
44f0b80109 alias: honor the [defaults] section, fix issue1642 2009-05-17 16:15:37 +02:00
Patrick Mezard
e391da8024 convert/bzr: warn when source is a lightweight checkout (issue1647) 2009-05-17 14:35:06 +02:00
Martin Geisler
9b272e271a tests: add missing interpreter lines 2009-05-17 02:15:21 +02:00
Martin Geisler
c40b8bf294 cvsnt-mergepoints test: use sh instead of bash 2009-05-17 02:10:09 +02:00
Martin Geisler
aedc0ac57f tests: removed unnecessary execute bit on Python tests 2009-05-17 01:42:21 +02:00
Martin Geisler
a645da9ed1 tests: renamed Python tests to .py 2009-05-17 01:39:31 +02:00
Martin Geisler
5930e2185d tests: renamed helper to avoid clash with stdlib repr module 2009-05-17 02:31:12 +02:00
Martin Geisler
9aedf5dabd tests: fix doc string in get-with-headers.py 2009-05-17 01:24:45 +02:00
Marti Raudsepp
1d10c4d979 tests: use repr.py to avoid binary characters in test output 2009-05-17 01:16:56 +02:00
Martin Geisler
4bdb838b6b tests: new helper for tests with binary output 2009-05-17 01:10:35 +02:00
Martin Geisler
fc8a97dac3 changelog: refuse to add revisions with empty usernames
An empty username or a username with a "\n" will make the revision
text contain two "\n\n" sequences -> corrupt repository.

The problem is that changelog.read expects to find exactly one "\n\n"
separator and thus cannot unpack the revision.
2009-05-16 11:12:49 +02:00
Patrick Mezard
d3d9100f4a convert/bzr: fix symlinks target (issue1626/2) 2009-05-15 16:12:09 +02:00
Martin Geisler
f138e91851 merge with crew-stable 2009-05-16 11:16:23 +02:00
Patrick Mezard
8a575f0b78 Merge with crew-stable 2009-05-15 16:17:56 +02:00
Dirkjan Ochtman
1e9b20dc8f mq: qpush shouldn't complain if working dir is at a non-tip head 2009-05-15 15:21:17 +02:00
Brett Carter
d69cd3912f clone: try updating to the actual changeset specified in options
When cloning with the -r option or # url format from a tag the destination
repo most likely won't have the tag. We can save the lookup result to get to
the correct parent anyway. Similar to issue1306, but for tags.
2009-05-14 22:00:56 +02:00