Commit Graph

96 Commits

Author SHA1 Message Date
Pierre-Yves David
fd393b84f3 pushkey: do not exchange obsole markers if feature is disabled
This apply to both push and pull both when client or server.
2012-07-28 13:33:06 +02:00
Mads Kiilerich
27e4baeebb test-hook.t: Solaris /usr/bin/egrep do not support {4} 2012-07-30 02:38:29 +02:00
Patrick Mezard
f40d444448 push: do not try to push remote obsolete if local has none 2012-07-24 21:20:56 +02:00
Simon Heimberg
8eb4380be9 hooks: print out more information when loading a python hook fails
When loading a python hook with file syntax fails, there is no
information that this happened while loading a hook. When the python
file does not exist even the file name is not printed. (Only that a
file is missing.)

This patch adds this information and a test for loading a non existing file and
a directory not being a python module.
2012-07-06 18:41:25 +02:00
Pierre-Yves David
9cbee4c2aa push: fix bug in detection of remote obsolete support
Current code check obsolete availability in local repo.
2012-07-12 03:03:19 +02:00
Simon Heimberg
387ef4195f tests: do exclude what is expected 2012-07-04 08:55:16 +02:00
Pierre-Yves.David@ens-lyon.org
d60eedc2d6 obsolete: exchange obsolete marker over pushkey
For a version of the exchange, all markers are exchange. This won't
scale and we will need a better protocol later.
2012-06-07 19:21:59 +02:00
Adrian Buehlmann
b761076e81 tests/printenv.py: eliminate trailing spaces on output 2012-06-17 00:27:31 +02:00
Adrian Buehlmann
4bb68f47e6 test-hook: adapt for Windows 2012-06-15 21:42:47 +02:00
Matt Mackall
05e48d4041 merge with stable 2012-05-13 12:52:24 +02:00
Levi Bard
ff2ee52b29 bookmarks: pull new bookmarks from remote by default (BC) 2012-05-12 17:00:01 +02:00
Bryan O'Sullivan
ab8ba40835 changelog: ensure that nodecache is valid (issue3428)
This ensures that an out-of-process hook can see an incoming changegroup.
2012-05-11 01:55:33 -07:00
Mads Kiilerich
93c3b99c27 tag: run commit hook when lock is released (issue3344) 2012-05-12 20:06:02 +02:00
Matt Mackall
31ad230c52 pull: backout change to return code
This bit a number of people.
2012-02-10 16:09:30 -06:00
Matt Mackall
902bee47a8 pull: return 1 when no changes found (BC)
Currently we have the following return codes if nothing is found:

                commit   incoming    outgoing      pull     push
intended           1        1           1            1       1
documented         1        1           1            0       1
actual             1        1           1            0       1

This makes pull agree with the rest of the table and makes it easy to
detect "nothing was pulled" in scripts.
2012-01-30 16:01:54 -06:00
Matt Mackall
1c8e8627b0 push: don't treat bookmark as a found change
Treating bookmarks as a found change results in confusing
documentation or output and is less useful for scripting.
2012-01-30 15:56:35 -06:00
Pierre-Yves David
7b8b0389cd push: prevent moving phases outside of the pushed subset 2012-01-20 21:21:13 +01:00
Mads Kiilerich
dbffdfd960 tag: invalidate tag cache immediately after adding new tag (issue3210)
New tags were written to .hgtags / .hglocaltags without updating or
invalidating the localrepo cache.

Before 462e6cfb1bac a lock was acquired soon after the new tags had been
written, and that invalidated the cache so the new tags for example could be
seen in pretxncommit hooks. With 462e6cfb1bac the lock had already been
acquired at this point and the missing cache invalidation was exposed.

The tag caches will now explicitly and immediately be invalidated when new tags
are added.
2012-01-19 02:14:06 +01:00
Matt Zuba
60b19beb18 hooks: prioritize run order of hooks
As of Mercurial 1.3, hooks are sorted in the order they are read into
Mercurial.  There are many instances when someone may want the hooks
sorted in a specific order; this patch allows prioritizing hooks, while
maintaining the existing enumeration for hooks without a priority.
2012-01-15 13:50:12 -07:00
Pierre-Yves David
0d9927b223 phases: exchange phase boundaries on push
For now phase sync is tried even if push fails with some know pathological
case. The exact behavior is to be discussed and implemented later.
2011-12-15 11:45:01 +01:00
Pierre-Yves David
c8f1983f55 phases: exchange phase boundaries on pull
Add an extra argument to addchangegroup to all phase code to execute before the
lock is released.
2011-12-15 11:28:42 +01:00
Mads Kiilerich
498fe2dc88 id: add command line options for handling ssh and https urls 2011-11-26 00:10:12 +01:00
Mads Kiilerich
a144f886ca tests: use 'hghave system-sh' to guard tests that requires sh in system() 2011-11-07 03:14:55 +01:00
Greg Ward
cf0ea44613 rollback: only restore dirstate and branch when appropriate.
If the working dir parent was destroyed by rollback, then the old
behaviour is perfectly reasonable: restore dirstate, branch, and
bookmarks. That way the working dir moves back to an existing
changeset rather than becoming an orphan.

But if the working dir parent was unaffected -- say, you updated to an
older changeset and then did rollback -- then it's silly to restore
dirstate and branch. So don't do that. Leave the status of the working
dir alone. (But always restore bookmarks, because that file refers to
changeset IDs that may have been destroyed.)
2011-09-18 19:59:33 -04:00
Idan Kamara
b335d3e278 dispatch: propagate ui command options to the local ui (issue2523)
so the ui object passed to pre/post python hooks has the verbose flag
(and the rest) set correctly
2011-06-13 00:19:26 +03:00
Peter Arrenbrecht
75fa0e5ea9 discovery: add new set-based discovery
Adds a new discovery method based on repeatedly sampling the still
undecided subset of the local node graph to determine the set of nodes
common to both the client and the server.

For small differences between client and server, it uses about the same
or slightly fewer roundtrips than the old tree-based discovery. For
larger differences, it typically reduces the number of roundtrips
drastically (from 150 to 4, for instance).

The old discovery code now lives in treediscovery.py, the new code is
in setdiscovery.py.

Still missing is a hook for extensions to contribute nodes to the
initial sample. For instance, Augie's remotebranches could contribute
the last known state of the server's heads.

Credits for the actual sampler and computing common heads instead of
bases go to Benoit Boissinot.
2011-05-02 19:21:30 +02:00
Brodie Rao
92f1644187 pushkey: add hooks for pushkey/listkeys 2011-05-01 11:12:36 +02:00
Kevin Bullock
111736008c id: add bookmarks to id
Since bookmarks are no longer merged with repo.tags() as of
8e2d23f4bd25, they don't show up in `hg id` as they used to. This adds
them back into the summary that `hg id` prints, and adds a
-B/--bookmarks flag alongside the -t/--tags and -b/--branch options.

Note this introduces a slight backwards-incompatibility: the summary
printed by `hg id` now separates bookmarks from tags with a space, as
seen below, instead of running it into the tags list.

Default summary output:

  $ hg id
  db815d6d32e6 tip/tag1 bm1/bm2

Output with --bookmarks:

  $ hg id --bookmarks
  bm1 bm2

See also 5672c9e8202d which adds bookmarks back into `hg summary`.
2011-02-18 17:09:08 -06:00
Gilles Moris
dcdc58f0a5 rollback: clarifies the message about the reverted state (issue2628)
Previously, when rolling back a transaction, some users could be confused
between the level to which the store is rolled back, and the new parents
of the working directory.

  $ hg rollback
  rolling back to revision 4 (undo commit)

With this change:
  $ hg rollback
  repository tip rolled back to tip revision 4 (undo commit)
  working directory now based on revision 2 and 1

So now the user can realize that the store has been rolled back to an older
tip, but also that the working directory may not on the tip (here we are
rolling back the merge of the heads 2 and 1)
2011-02-10 09:03:06 +01:00
Mads Kiilerich
e4660104cf util: flush stdout before calling external processes
stdout could have content in its buffer while a subprocess ran and emitted
output.

Flushing stdout ensures that output now comes in the right order.
2011-02-18 03:35:01 +01:00
Mads Kiilerich
3e84017cf0 tests: use printenv.py where it is - don't copy it around 2011-02-15 02:17:43 +01:00
Mads Kiilerich
43329863bd tests: let printenv.py show the real values
Test paths are now hidden by the test framework, so HG_URL no longer needs
mangling.
2011-02-15 01:05:32 +01:00
Dan Villiom Podlaski Christiansen
83b3b076d6 hooks: sort any dictionaries set in the environment
The actual order of dictionary items is implementation-defined in
Python, and differs between CPython and PyPy. With this change,
test-hooks.t passes with PyPy.
2010-12-24 15:22:00 +01:00
Dan Villiom Podlaski Christiansen
c168860461 make_file: always return a fresh file handle that can be closed
Currently, cmdutil.make_file() will return a freshly made file handle,
except when given a pattern of '-'. If callers would want to close the
handle, they would have to make sure that it's neither sys.stdin or
sys.stdout. Instead, returning a duplicate of either of the two
ensures that make_file() lives up to its name and creates a new
file handle regardless of the input.
2010-12-07 16:08:16 +01:00
Mads Kiilerich
3174ff376b tests: remove redundant globs
Many globs now just match $TESTTMP and is no longer needed.
2010-10-08 22:36:10 -05:00
Erik Zielke
512d0992fc tests: removed test names in tests
The name of the test files is replaced with a glob * expression,
thereby the tests does not depend on the filename of the file they are
in.
2010-09-30 09:49:40 +02:00
Martin Geisler
3d112b3042 tests: added a short description to issue numbers
Many tests already had a short line to describe what IssueXXX is
about. I find that quite useful when reading a test.
2010-09-24 10:13:49 +02:00
Brodie Rao
b5fe0d906e tests: add glob matching for unified tests
This adds a " (glob)" marker that works like a simpler version of
(re): "*" is converted to ".*", and "?" is converted to ".".

Both special characters can be escaped using "\", and the backslash
itself can be escaped as well.

Other glob-style syntax, like "**", "[chars]", or "[!chars]", isn't
supported.
2010-09-22 16:06:02 -05:00
Brodie Rao
7d7d96bd74 tests: require regexes in unified tests to be marked with " (re)"
Consider this test:

  $ hg glog --template '{rev}:{node|short} "{desc}"\n'
  @  2:20c4f79fd7ac "3"
  |
  | o  1:38f24201dcab "2"
  |/
  o  0:2a18120dc1c9 "1"

Because each line beginning with "|" can be compiled as a regular
expression (equivalent to ".*|"), they will match any output.

Similarly:

  $ echo foo


The blank output line can be compiled as a regular expression and will
also match any output.

With this patch, none of the above output lines will be matched as
regular expressions. A line must end in " (re)" in order to be matched
as one.

Lines are still matched literally first, so the following will pass:

  $ echo 'foo (re)'
  foo (re)
2010-09-22 16:06:00 -05:00
Brodie Rao
3ed54dfa3d tests: improve regexes in unified tests 2010-09-22 16:05:58 -05:00
Matt Mackall
200e89394d tests: fix a bunch of pointless #s in unified tests 2010-09-17 17:03:08 -05:00
Matt Mackall
bf9417da11 tests: exit 0 no longer needed on unified tests 2010-09-17 17:03:04 -05:00
Matt Mackall
08439e0f2d tests: add exit codes to unified tests 2010-09-16 17:51:32 -05:00
Martin Geisler
cc612c476f tests: remove unneeded -d flags
Many tests fixed the commit date of their changesets at '1000000 0' or
similar. However testing with "Mon Jan 12 13:46:40 1970 +0000" is not
better than testing with "Thu Jan 01 00:00:00 1970 +0000", which is
the default run-tests.py installs.

Removing the unnecessary flag removes some clutter and will hopefully
make it clearer what the tests are really trying to test. Some tests
did not even change their output when the dates were changed, in which
case the -d flag was truly irrelevant.

Dates used in sequence (such as '0 0', '1 0', etc...) were left alone
since they may make the test easier to understand.
2010-09-02 23:22:51 +02:00
Nicolas Dumazet
39fada51ff tests: remove useless sed in test-hook 2010-08-12 19:40:22 +09:00
Nicolas Dumazet
fdbcb407cb tests: unify test-hook 2010-08-12 19:38:31 +09:00