Commit Graph

22 Commits

Author SHA1 Message Date
Bryan O'Sullivan
39c3672fd0 tag: handle .hgtags and .hg/localtags with missing final newline (issue 601)
This also fixes an asymmetry bug in which we called the pretag hook if we
were going to create a local tag, but didn't call the tag hook afterwards.
2007-07-16 20:15:03 -07:00
Patrick Mezard
82fd511346 printenv: filter empty environment variables for portability. 2007-06-20 22:06:37 +02:00
Thomas Arendsen Hein
3dcf92c53d Use printenv.py for pre/post-command-hooks (fixes tests on Solaris, too) 2007-06-19 08:17:55 +02:00
Matt Mackall
c61bc27ccc dispatch: add generic pre- and post-command hooks 2007-06-18 17:49:56 -05:00
Alexis S. L. Carvalho
c035cb5e84 test-hook: use printenv.py 2007-03-26 23:49:58 -03:00
Alexis S. L. Carvalho
6dc09d1834 Fix hg showconfig traceback with values that aren't strings 2007-02-15 10:15:08 -02:00
Alexis S. L. Carvalho
20406a3e01 Handle functions as the value of a hooks.<name> config variable
This should make it easier for extensions to add a hook when
they're loaded.
2007-02-09 03:48:28 -02:00
Matt Mackall
72659a3964 merge: use repo.parents and parent contexts in update 2006-09-29 16:39:38 -05:00
Matt Mackall
4e0e3a1e78 tag: shorten hash in default commit message
Move default message to commands.py
Pass node in binary for consistency
Remove default arguments
Fix up tests
2006-08-20 23:52:52 -05:00
Vadim Gelfer
0778999161 hooks: add url to changegroup, incoming, prechangegroup, pretxnchangegroup hooks
all repository classes now have url() method that returns url of repo.
2006-07-25 13:50:32 -07:00
Vadim Gelfer
1f1118a083 hooks: add preupdate and update hooks.
preupdate run before working dir updated. can prevent update.
update run after working dir updated.
2006-05-11 10:14:48 -07:00
Thomas Arendsen Hein
46d0753ec7 Make hg update more verbose by default (issue12)
(including small changes to revert and backout to not show these stats
 with the exception of backout --merge)

Show update stats (unless -q), e.g.:
K files updated, L files merged, M files removed, N files unresolved

Inform the user what to do after a merge:
(branch merge, don't forget to commit)

Inform the user what to do if a branch merge failed:
There are unresolved merges, you can redo the full merge using:
  hg update -C X
  hg merge Y

Inform the user what to do if a working directory merge failed:
There are unresolved merges with locally modified files.
2006-05-02 18:44:02 +02:00
Vadim Gelfer
2607813e53 support hooks written in python.
to write hook in python, create module with hook function inside.
make sure mercurial can import module (put it in $PYTHONPATH or load it
as extension).  hook function should look like this:

def myhook(ui, repo, hooktype, **kwargs):
   if hook_passes:
      return True
   elif hook_explicitly_fails:
      return False
   elif some_other_failure:
      import util
      raise util.Abort('helpful failure message')
   else:
      return
      # implicit return of None makes hook fail!

then in .hgrc, add hook with "python:" prefix:

[hooks]
commit = python:mymodule.myhook
2006-04-28 15:50:22 -07:00
Thomas Arendsen Hein
1b244c77c7 Use 'hg ci -d "1000000 0"' in tests to circumvent problem with leading zero.
Some systems show "Thu Jan 01" instead of "Thu Jan  1", which breaks tests.
Using "1000000" yields "Mon Jan 12 13:46:40 1970", which looks the same on
all systems.
2006-03-13 13:05:41 +01:00
Thomas Arendsen Hein
b561567e6a Call hooks in alphabetical (=defined) order, of course still grouped by type.
Output of test-hook adjusted.
2006-03-06 17:34:49 +01:00
Vadim Gelfer
d1f78f49f0 add preoutgoing and outgoing hooks.
preoutgoing lets prevent pull over http or ssh.
outgoing lets notify after pull.
2006-02-17 08:26:21 -08:00
Vadim Gelfer
6c96629693 i forgot to change the test output for test-hook. 2006-02-16 14:34:59 -08:00
Matt Mackall
16d3876ce7 Change test-hook to test multiple hooks 2005-10-29 13:45:01 -07:00
mpm@selenic.com
ea7bd9ea6f run-tests: remove '+ hg' trick
This was causing me a fair amount of debugging confusion. Let's just
forget it entirely. Updated tests to match.
2005-08-16 19:03:01 -08:00
Thomas Arendsen Hein
87aabef405 Updated output of tests. 2005-07-29 15:21:02 +01:00
mpm@selenic.com
3a08ca5eaa Update tests to use commit -m and default -u
manifest hash: 6e4385453843031a712005a320d6000595b40d05
2005-07-21 15:05:17 -05:00
mpm@selenic.com
1bbff51e92 Add initial hook support
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Add initial hook support

This adds the basic hook code as well as pre and post-commit hooks.
Argument passing is by environment variable key/value pairs so that
extra data can be passed over time. File lists will generally not be
passed to hooks as these can be extremely long (>1M).

manifest hash: 45cf9bab432782c391bc9c1c048c84cc75d52740
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)

iD8DBQFCwOukywK+sNU5EO8RAsVsAJ9QipR2aKRSSvoRNo+3If6JddUDkwCgkZrM
KEmZpUOxhNHqezFVrHDRTjE=
=aedm
-----END PGP SIGNATURE-----
2005-06-27 22:18:12 -08:00