Commit Graph

387 Commits

Author SHA1 Message Date
Matt Mackall
887599574c Sync with -stable 2006-12-17 21:48:22 -06:00
Benoit Boissinot
fc997dfbf2 fix calculation of new heads added during push with -r
fix issue450
2006-12-17 05:00:22 +01:00
Matt Mackall
296d6a7cb8 Simplify i18n imports 2006-12-14 20:25:19 -06:00
Matt Mackall
f17a4e1934 Replace demandload with new demandimport 2006-12-13 13:27:09 -06:00
Matt Mackall
2623870448 Remove deprecated old-style branch support 2006-12-12 18:16:23 -06:00
Alexis S. L. Carvalho
63ae667098 Use UTF-8 in .hg/branch 2006-12-10 20:35:28 -02:00
Thomas Arendsen Hein
ff6b40fc67 Indicate the purpose of the dummy changelog file in itself.
Otherwise people getting an error message with an old installation might
wonder why this file is corrupted.
2006-12-10 23:03:53 +01:00
Matt Mackall
6d9bbc8702 Merge Benoit's .hg/store support 2006-12-10 02:11:02 -06:00
Alexis S. L. Carvalho
edf9fef62b Allow the user to specify the fallback encoding for the changelog
Example: use EUC-JP instead of ISO-8859-1:

[ui]
fallbackencoding = EUC-JP
2006-12-08 22:01:05 -02:00
Alexis S. L. Carvalho
3b575d7b19 fix encoding conversion of branch names when mq is loaded 2006-12-07 14:35:43 -02:00
Thomas Arendsen Hein
f6d571d204 Don't report an error when closing heads during local push (issue387) 2006-12-05 23:25:28 +01:00
Brendan Cully
0de5c9a6d8 Add "null" pseudo-tag pointing to nullid 2006-12-05 13:41:42 -08:00
Benoit Boissinot
84f8507dc8 introduce localrepo.spath for the store path, sopener fixes 2006-12-05 11:28:23 +01:00
Benoit Boissinot
c3c63edfe1 localrepo: change aftertrans to be independant of the store path 2006-12-05 11:28:21 +01:00
Benoit Boissinot
e005ffc8c4 switch to the .hg/store layout, fix the tests 2006-12-01 13:34:09 +01:00
Benoit Boissinot
69d31c9562 add "requires" file to the repo, specifying the requirements 2006-12-10 00:06:59 +01:00
Benoit Boissinot
e2ded4fa21 move code around 2006-12-10 00:06:45 +01:00
Matt Mackall
aaf36f881a Handle transcoding of branch names 2006-12-03 16:16:33 -06:00
Matt Mackall
299a930c93 Handle transcoding of tags 2006-12-03 16:16:33 -06:00
Alexis S. L. Carvalho
e953792af4 Ignore all errors while parsing the branch cache. 2006-12-02 03:38:55 -02:00
Matt Mackall
05748f203d merge: handle directory renames
commit: handle new copy dirstate case correctly
findcopies:
 keep a map of all copies found for directory logic
 add dirs filter
 check for merge:followdirs config option
 generate a directory move map
 find files that match directory move map
manifestmerge:
 add directory rename cases
applyupdates:
 skip actions with None file
 add "d" action
recordupdates:
 add "d" action
add simple directory rename test
2006-11-30 17:36:33 -06:00
Benoit Boissinot
3bad25e752 only print a warning when no username is specified
- revert most of 8b55c0ba
- display the username during interactive commit
2006-11-28 21:16:05 +01:00
Benoit Boissinot
6d0bb2e251 add a comment about '\n' and '\r' and streaming clone 2006-11-28 19:11:46 +01:00
Benoit Boissinot
684e2e23c3 don't create the .hg/data at init time 2006-11-27 22:22:44 +01:00
Thomas Arendsen Hein
0bafb6f99d Corrected "waiting for lock on repository FOO held by BAR" message.
BAR was the error number and not the locker name.
Use repr on BAR, so problems can be detected easier.
2006-11-20 19:55:59 +01:00
Thomas Arendsen Hein
f3d842aee0 Handle locking exceptions if streaming clone can't lock the repo. (Issue324) 2006-11-20 19:41:49 +01:00
Matt Mackall
303ec3f442 correct remote heads test in prepush 2006-11-19 16:32:36 -06:00
Matt Mackall
38933f0e7f reorder tests in prepush
It's more useful to show the new branches message than the unsynced
changes message.
2006-11-19 16:32:36 -06:00
Alexis S. L. Carvalho
858dee209b Revert almost all of 0ab603017f82; add a test
Because of file copies, we should update the manifest dict only after
committing all files.
2006-11-18 19:44:42 -02:00
Alexis S. L. Carvalho
f83694a0f9 don't use readline() to read branches.cache
The posixfile_nt class used on windows doesn't have that method.
2006-11-15 17:56:57 -02:00
Brendan Cully
438aa7d879 Export changelog dict in localrepo.commit 2006-11-08 11:28:33 -08:00
Thomas Arendsen Hein
73ed740a36 Fix accessing a repository via -R/--repository through a symlink.
Sometimes the repository root was compared to os.getcwd(), which always uses
the canonical path without symbolic links in it.

This would changes self.root of the localrepo objects to always use os.sep as
the directory separator, which is implicitly assumed in some places, but may
not be the case if somebody uses -R foo/repo on windows.
2006-11-07 22:35:07 +01:00
Benoit Boissinot
0e56ff2f66 localrepo: factor commit and rawcommit
note: rawcommit with an empty text will now launch the editor
2006-11-07 21:43:19 +01:00
Benoit Boissinot
e8fd91f783 localrepo.commit: little cleanups
- use a list for new fileids
- sort the removed files
2006-11-07 21:43:15 +01:00
Thomas Arendsen Hein
687e4a7111 Define and use nullrev (revision of nullid) instead of -1. 2006-10-29 10:53:51 +01:00
Alexis S. L. Carvalho
17f016acd0 Correct optimization from 56bc6966622e; add a test.
If there are two (or more) heads that point to the same .hgtags
node, we can safely skip parsing the file in all but the last head.
(In 56bc6966622e, we were parsing the file in the first head and
skipping all the others.)
2006-10-28 23:37:59 -03:00
Thomas Arendsen Hein
11cdc6b21b Merge with upstream 2006-10-27 23:09:46 +02:00
Matt Mackall
5186d07f32 improve walk docstrings 2006-10-27 11:24:10 -05:00
Thomas Arendsen Hein
a0477d89a5 New UnexpectedOutput exception to catch server errors in localrepo.stream_in
If the unexpected is a string, the empty string will be mentioned, and long
strings are cut to at most 400 chars.
2006-10-27 18:17:12 +02:00
Thomas Arendsen Hein
47d731406a Show number (-v) and list (--debug) of changesets with bundle/pull/push etc. 2006-10-25 18:45:18 +02:00
Brendan Cully
45cd7b7440 Merge with mpm 2006-10-24 13:42:21 -07:00
Matt Mackall
49503fb772 Merge with crew 2006-10-24 13:46:04 -05:00
Alexis S. L. Carvalho
9ede4a440a Split branchtags into two additional functions.
This makes it easier to override only parts of the cache saving process.
2006-10-23 23:32:56 -03:00
Matt Mackall
862620d6bf localrepo: add separate methods for manipulating repository data
This change adds new methods sjoin and sopener for accessing the
following elements:

 - changelog
 - manifest
 - data/
 - journal and undo log
 - repo lock

This will simplify sharing this data and escaping paths
2006-10-23 17:12:20 -05:00
Benoit Boissinot
3f09dfef56 use xrange instead of range 2006-10-19 14:16:51 +02:00
Matt Mackall
8be8fbef1f Minor tags optimization 2006-10-18 22:38:23 -05:00
Matt Mackall
aa8e8c430f Use file contexts in tags code 2006-10-18 14:14:59 -05:00
Matt Mackall
4a6017f8e8 Only look up tags and branches as a last resort 2006-10-18 11:44:56 -05:00
Matt Mackall
007b438590 If we can't write the branch cache, fail quietly. 2006-10-18 10:46:51 -05:00
Benoit Boissinot
2bc50de330 invalidate the branch cache when sanity check fails 2006-10-18 09:26:23 +02:00
Eric Hopper
b804ede3e2 Stop erroring out pull -r and clone -r if repository isn't local. 2006-09-09 18:25:07 -07:00
Matt Mackall
4b6a4d5cb0 Improve branch cache sanity check for mq 2006-10-18 02:08:33 -05:00
Matt Mackall
12537f44dc commit: read branch with workingctx 2006-10-17 22:26:14 -05:00
Matt Mackall
af917449ea branchtags: use changectx
setting self.branchcache on entry avoids recursions in lookup
2006-10-17 22:09:56 -05:00
Matt Mackall
fd5ffbb139 Add branch support to commit 2006-10-17 18:32:00 -05:00
Matt Mackall
587d11648a Make lookup aware of branch labels
adjust precedence order slightly:

- '.'
- tags
- branch labels
- revlog order
2006-10-17 18:31:56 -05:00
Matt Mackall
fefe69bcd1 Add branchtags function with cache
- cache stores tipmost node and rev and node,label pairs
- if cache is out of date, scan new changesets
- write new cache out after scan
2006-10-17 18:31:18 -05:00
Alexis S. L. Carvalho
f0031e0717 rawcommit: add removed files to the changelog file list
patch by tonfa.
2006-10-12 19:26:06 -03:00
Alexis S. L. Carvalho
2182538090 ui.py: remove revlogopts and (unused) diffcache variables
This should make the [revlog] section in a .hg/hgrc file be respected
when there's still no changelog.
2006-10-10 18:43:20 -03:00
Thomas Arendsen Hein
f8cc3a01a4 merge with upstream 2006-10-10 09:30:05 +02:00
Benoit Boissinot
4e11486432 fix localrepo.status when dealing with x-bit changes 2006-10-10 00:02:30 +02:00
Matt Mackall
88a9662e9f commit: unify file-level commit code 2006-10-09 14:02:01 -05:00
Matt Mackall
9c3978e6ef Use filelog.cmp in checkfilemerge 2006-10-08 20:18:59 -05:00
Matt Mackall
ddd540c49d merge: remember rename copies and parents properly on commit
record copies in dirstate even if rename was remote
  this lets us record it properly at commit
teach checkfilemerge about copies, including merge cases
pull old copy code out of commit
extend rename-merge1 test to show file index
2006-10-08 19:57:45 -05:00
Brendan Cully
de0df5a89b Merge with upstream 2006-10-03 12:14:33 -07:00
Matt Mackall
93a98b345e merge: use new working context object in update 2006-10-03 01:21:46 -05:00
Thomas Arendsen Hein
0a7b982aa6 Whitespace/Tab cleanup 2006-10-01 19:26:33 +02:00
Matt Mackall
b707245da4 localrepo.parents: return null context for no parents 2006-09-29 15:56:36 -05:00
Matt Mackall
ead8d7c353 Add localrepo.parents to get parent changectxs. 2006-09-29 15:48:16 -05:00
Brendan Cully
8104550ace Move defaultrev into changectx
This also causes tag on a repository with no working directory
to default to tip.
2006-09-15 15:23:52 -07:00
Thomas Arendsen Hein
3bf23a7d35 If local repository is missing, make error message clearer.
Faheem Mitha suggested finding a better error message.
The nice error message is taken from cogito.
2006-09-11 10:08:30 +02:00
Thomas Arendsen Hein
d2082f10fc Never apply string formatting to generated errors with util.Abort.
Otherwise error messages containing % chars yield errors or worse.
Fixed (hopefully) all users of util.Abort.
2006-09-08 09:36:18 +02:00
Benoit Boissinot
4456f11f57 localrepo: move the repo creation code, fail if the repo exists 2006-09-02 23:06:47 +02:00
Benoit Boissinot
5e11bd63c0 fix incorrect warning when walking on a particular rev
when a directory was given instead of a file it reported
incorrectly 'No such file or directory in rev <rev>'
we test if the file is a prefix directory
2006-08-28 21:49:02 +02: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
Matt Mackall
62b10cb784 Demote a pull note to a debug message 2006-08-20 21:59:51 -05:00
Alexis S. L. Carvalho
ca387842ee localrepo.status: detect clean files even when the mtime has changed 2006-08-20 00:44:54 -03:00
Matt Mackall
b5a0f2743c filelog: add hash-based comparisons
For status, rather than reconstruct full file versions from revlog for
comparison, compare hashes.
2006-08-14 15:07:00 -05:00
Vadim Gelfer
80d6f2f7c7 remove localrepository.changes.
use localrepository.status instead.
2006-08-12 16:40:12 -07:00
Vadim Gelfer
dc377b58c1 update copyrights. 2006-08-12 12:30:02 -07:00
Alexis S. L. Carvalho
219803f060 Fix some bugs introduced during the manifest refactoring 2006-08-12 08:53:23 -03:00
Matt Mackall
5c0d170547 Remove manifest.readflags 2006-08-11 11:00:38 -05:00
Matt Mackall
44b96c96eb Change remaining users of manifest flags 2006-08-11 10:57:42 -05:00
Matt Mackall
7c0506a4f5 Merge manifest refactor work 2006-08-09 15:03:46 -05:00
Vadim Gelfer
b365694c04 fetch: hold lock and wlock across all operations 2006-08-08 17:08:59 -07:00
Matt Mackall
3dcc28a29a Merge with crew 2006-08-07 16:47:06 -05:00
Vadim Gelfer
dc56cac613 localrepo.update: allow to suppress commit reminder. 2006-08-07 17:22:17 -07:00
Matt Mackall
d5009b5b05 Move repo.verify 2006-08-07 16:27:09 -05:00
Brendan Cully
b5f7a6230c Add '.' as a shortcut revision name for the working directory parent. 2006-08-04 14:36:03 -07:00
Matt Mackall
65b6faa1aa Move merge code to its own module
Pull update and merge3 out of localrepo into merge.py
s/self/repo/
Add temporary API function in hg.py
Convert all users
2006-08-03 15:24:41 -05:00
Vadim Gelfer
b7a96d1742 clean up hg.py: move repo constructor code into each repo module 2006-07-31 07:11:12 -07: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
9738466350 status: add -c (clean) and -A (all files) options
also add new localrepo.status what is more uniform than localrepo.changes.
localrepo.changes is deprecated and will go away soon.
2006-07-20 16:21:07 -07:00
Matt Mackall
6a4cbda08b manifestflags: eliminate remaining users of direct dict access 2006-07-19 19:11:50 -05:00
Matt Mackall
4e6cb39019 Start using manifestflags methods 2006-07-16 03:14:17 -05:00
Vadim Gelfer
f7b6882acb clone: disable stream support on server side by default.
enable in hgrc like this:
[server]
stream=True
2006-07-15 16:06:35 -07:00
Vadim Gelfer
4bc0558c57 clone: do not make streaming default. add --stream option instead. 2006-07-14 14:51:36 -07:00
Vadim Gelfer
9ea4436262 add support for streaming clone.
existing clone code uses pull to get changes from remote repo.  is very
slow, uses lots of memory and cpu.

new clone code has server write file data straight to client, client
writes file data straight to disk.  memory and cpu used are very low,
clone is much faster over lan.

new client can still clone with pull, can still clone from older servers.
new server can still serve older clients.
2006-07-14 11:17:22 -07:00
Vadim Gelfer
a7c3b963b0 move most of tag code to localrepository class. 2006-07-12 08:59:20 -07:00
Benoit Boissinot
be9e8c572e allow use of extensions in python hooks
extensions are loaded with hgext_ prefix, try to use them if
the module is not found in the normal path
2006-07-09 11:10:11 +02:00
Benoit Boissinot
79ae0c65b1 coding style: use spaces instead of tabs 2006-07-08 16:55:49 +02:00
Matt Mackall
ae5d801274 Merge context patches 2006-07-05 13:28:25 -05:00
Vadim Gelfer
95fcf73027 merge with crew. 2006-07-03 10:19:09 -07:00
Thomas Arendsen Hein
96ef4def0a Clarified message when nothing to merge is seen.
Sometimes there's a non-tip head waiting to be merged, especially after
pulling in remote changes while there were local modifications in the working
directory which had to be committed before 'hg merge' can work.
2006-07-03 19:14:29 +02:00
Sean Meiners
34ff4a6539 Added ability to clone from a local repository to a (new) remote one.
Rearranged the clone command a good bit to make sure it validates that
the source does exist and that the destination doesn't before doing anything.
Before I moved the source repo check it would create the destination
repository before it verified the source existed.

Moved the responsibility for creating the destination repo root directory
entirly into the localrepo class so that local to local cloning doesn't break.
This also simplifies the code a bit since it's no longer being done in both
clone and init.

Changed the names of the 'repo' and 'other' variables to 'dest_repo' and
'src_repo' to maintain my sanity.

Passes 82/83 tests. The only failure is the version number test, which I
suspect is supposed to fail since it comes from a generated file.
2006-06-30 19:24:02 -07:00
Matt Mackall
828e814bf2 Add context helper functions to localrepo 2006-06-28 17:08:10 -05:00
Chris Mason
2124a015d1 Fix localrepo.changes() Correctly decide if we are diffing the working dir 2006-06-23 16:42:48 -07:00
Vadim Gelfer
c6946676ed fix bug in localrepo.changes.
caused by a7bed91ac70412cad91b76f93863bba06d289ff4.
2006-06-21 16:20:21 -07:00
Vadim Gelfer
f6098bdc1f merge with crew. 2006-06-21 09:32:31 -07:00
Chris Mason
4bb4096145 Fix cold cache diff performance
cold cache diff performance has regressed in two ways.  localrepo.changes
has optimizations for diffing against the working dir parent that expect
node1 to be None.  commands.revpair() usage means that commands.dodiff()
never sends node1 == None.  This is fixed in localrepo.changes by checking
against the dirstate parents.

In the non-dirstate parents case, localrepo.changes does a loop comparing
files without first sorting the file names, leading to random access
across the disk.
2006-06-21 09:28:48 -07:00
Vadim Gelfer
cbbcaa74fe merge with crew. 2006-06-20 23:58:45 -07:00
Vadim Gelfer
9a0c813fdc use demandload more. 2006-06-20 23:58:21 -07:00
Vadim Gelfer
f40e35da3c localrepository.push: propagate return value 2006-06-20 15:14:12 -07:00
Vadim Gelfer
6144b74dd7 replace os.stat with os.lstat in some where. 2006-06-16 12:58:24 -07:00
Vadim Gelfer
9117f9f380 extend network protocol to stop clients from locking servers
now all repositories have capabilities slot, tuple with list of names.

if 'unbundle' capability present, repo supports push where client does
not need to lock server.  repository classes that have unbundle capability
also have unbundle method.

implemented for ssh now, will be base for push over http.

unbundle protocol acts this way.  server tells client what heads it
has during normal negotiate step.  client starts unbundle by repeat
server's heads back to it.  if server has new heads, abort immediately.
otherwise, transfer changes to server.  once data transferred, server
locks and checks heads again.  if heads same, changes can be added.
else someone else added heads, and server aborts.

if client wants to force server to add heads, sends special heads list of
'force'.
2006-06-15 16:37:23 -07:00
Thomas Arendsen Hein
56a3c0876e Report on push/pull if heads are merged, too, like for new heads.
Use case: If a remote repo has two heads and I _want_ to merge them, I merge
and push. Meanwhile someone else pushed on top of one of the heads. He won't
get a warning, because he doesn't create a new head, I won't notice that I
don't close a head, because I don't get a message telling me.
2006-06-10 17:39:29 +02:00
Benoit Boissinot
55cbea1661 remove appendfile for the manifest when adding a changegroup
Since the changelog is using appendfile, the manifest entries cannot
be referenced, so we don't need to use append file for the manifest.
2006-06-04 17:46:33 +02:00
Thomas Arendsen Hein
4b040d1963 Renamed localrepo.undo() to rollback() and talk about "rollback information". 2006-06-01 19:08:29 +02:00
Thomas Arendsen Hein
5800bfc290 Manifest groups may be empty, so don't abort in this case (fixes issue210).
Only abort on empty changelog and file revlogs.
2006-05-31 22:25:20 +02:00
Benoit Boissinot
7f2c70ddf8 use a more reliable way to find what are the new changesets on pull/unbundle
The number of csets and the hooks where wrong (negative number of csets) when
we unbundled a bundle which contains csets we already had.
Remove unused variables.
2006-05-24 10:59:30 +02:00
Benoit Boissinot
d91b489a27 merge with crew 2006-05-24 09:27:16 +02:00
Benoit Boissinot
c070465611 n is always 'True', we can only stop the loop with the break statement 2006-05-24 01:01:39 +02:00
Benoit Boissinot
ba6fa6a223 document and fix findincoming
- add documentation about what the function does, notably
  the fact that it updates 'base'
- transform the workflow to a more simple 'if elif elif else'
- do not call remote.branches if not necessary
- some nodes where missing in 'base' (from what I understand,
  if the root of a branch is missing but one parent is present,
  the parent should be in 'base')
- add a testcase for an incorrect outgoing that is fixed by
  this cset
- add a testcase for an empty group bug, it needs fixing
2006-05-23 10:44:40 +02:00
Vadim Gelfer
b8bc35963b add ui.print_exc(), make all traceback printing central. 2006-05-22 08:47:53 -07:00
Vadim Gelfer
5eb540c338 fix parsing of tags. make parse errors useful. add new tag tests.
old code read every head of .hgtags. delete and recreate of .hgtags gave
new head, but if error in deleted rev, .hgtags had error messages every
time it was parsed. this was very hard to fix, because deleted revs hard
to get back and update, needed merges too.

new code reads .hgtags on every head. advantage is if parse error
happens with new code, is possible to fix them by editing .hgtags on a
head and committing.

NOTE: new code uses binary search of manifest of each head to be fast,
but still much slower than old code. best thing would be to have delete
record stored in filelog so we never touch manifest. could find live
heads directly from filelog. this is more work than i want now.

new tests check for parse of tags on different heads, and inaccessible
heads created by delete and recreate of .hgtags.
2006-05-18 23:31:12 -07:00
Thomas Arendsen Hein
be0ce7238f Strip empty lines and trailing spaces around commit messages.
Fixes issue213 and part of issue249 (trying to keep node id on import)
2006-05-17 19:38:41 +02:00
Vadim Gelfer
aa621a0ae1 remove non-prefixed environment variables from hooks. 2006-05-15 09:13:00 -07:00
Vadim Gelfer
c278e6a6c4 merge with crew. 2006-05-11 14:46:24 -07:00
john.levon@sun.com
28c6c53f5e Force editor to appear for an 'hg backout' if a message or logfile aren't
supplied. Pre-fill the commit message with the changeset being backed out.
Fixes bug 238.
2006-05-11 14:32:09 -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
Vadim Gelfer
0a3e1cd1e7 localrepo.update: abort if outstanding merges, instead of warn/return 1 2006-05-11 09:43:50 -07:00
Benoit Boissinot
7994bf99a6 fix a traceback when unbundling does not add any changesets
only run the hooks when some changesets has been added
2006-05-11 15:01:30 +02:00
Thomas Arendsen Hein
571a43feca Always remove appendopener tmp files (fixes issue235).
test-hup triggered this bug by killing "hg serve --stdio".
2006-05-09 17:03:00 +02:00
Vadim Gelfer
990eecd90f localrepository.addchangegroup: add more source infos to hooks 2006-05-08 16:50:27 -07:00
Vadim Gelfer
724c8bd48c changegroup hooks: add source to hook parameters 2006-05-08 16:07:56 -07:00
mason@suse.com
58d4ef2538 Use revlogng and inlined data files by default
This changes revlog specify revlogng by default.  Inlined
data files are also used unless a flags option is found in the .hgrc.
Some example hgrc files:

[revlog]
# use the original revlog format
format=0

[revlog]
# use revlogng.  Because no flags are included, inlined data files
# also be selected
format=1

[revlog]
# use revlogng but do not inline the data files with the index
flags=

[revlog]
# the new default
format=1
flags=inline
2006-05-08 14:26:18 -05:00
Vadim Gelfer
41eb4e2c6e reverse sense of return value from python hooks.
old scheme (False/None/0/'' == fail) made coding style
unnatural, did not allow use of mercurial commands as hooks.

new scheme (False/None/0 == pass) is pythonic, does not require peculiar
"return True" at ends of hooks, allows hooks like this:

[hooks]
# update working dir after push into this repo
changegroup.update = python:mercurial.commands.update
2006-05-08 10:59:58 -07:00
Vadim Gelfer
991036f426 fix minor bugs in localrepo.hook. 2006-05-03 11:00:24 -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
e68d5a8805 merge with crew. 2006-04-30 16:30:57 -07:00
Vadim Gelfer
b5e4f14fb3 do not check sys.argv from localrepo when running hooks.
instead add traceback field to ui class.
2006-04-30 16:30:39 -07:00
Thomas Arendsen Hein
092be2daa9 Use better names (hg-{usage}-{random}.{suffix}) for temporary files. 2006-04-30 21:11:22 +02:00
Vadim Gelfer
3459035f6b merge with crew. 2006-04-28 15:50:56 -07: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
cc2267150a Show repo's revlog format on verify only if it doesn't match the default format.
This makes it easier to run the tests with different revlog formats.
2006-04-28 21:52:08 +02:00
Benoit Boissinot
8e35361260 fix a NameError in changegroupsubset 2006-04-28 11:36:33 +02:00
Vincent Danjean
707a0004ce allow to pull from an empty repo without getting a backtrace 2006-04-27 22:29:02 -07:00
Thomas Arendsen Hein
f48347c44f Show repo's revlog format on verify. Warn if some files use a different format. 2006-04-27 21:58:47 +02:00
Thomas Arendsen Hein
c9a89940a1 Replaced 0 with REVLOGV0 where this meaning is used. 2006-04-27 21:16:46 +02:00
Matt Mackall
2cd0e1932b Revert push new heads logic
This breaks push -r's new head detection but fixes the common case.

For now we'll assume that someone doing push -r knows what they're doing.
2006-04-21 16:30:23 -05:00