Mercurial > hg
changeset 1732:d3e6da334b85
merge with crew.
author | Vadim Gelfer <vadim.gelfer@gmail.com> |
---|---|
date | Thu, 16 Feb 2006 08:51:24 -0800 |
parents | 019e6a47a53e (current diff) 251729df9cc6 (diff) |
children | 6d288d8c3ca6 |
files | doc/hgrc.5.txt mercurial/commands.py mercurial/localrepo.py |
diffstat | 4 files changed, 43 insertions(+), 13 deletions(-) [+] |
line wrap: on
line diff
--- a/doc/hg.1.txt Thu Feb 16 08:48:31 2006 -0800 +++ b/doc/hg.1.txt Thu Feb 16 08:51:24 2006 -0800 @@ -223,9 +223,11 @@ probably with undesirable results. options: - -a, --text treat all files as text - -I, --include <pat> include names matching the given patterns - -X, --exclude <pat> exclude names matching the given patterns + -a, --text treat all files as text + -I, --include <pat> include names matching the given patterns + -p, --show-function show which function each change is in + -X, --exclude <pat> exclude names matching the given patterns + -w, --ignore-all-space ignore white space when comparing lines export [-o filespec] [revision] ...:: Print the changeset header and diffs for one or more revisions. @@ -600,9 +602,12 @@ This lists both regular and local tags. -tip:: +tip [-p]:: Show the tip revision. + options: + -p, --patch show patch + unbundle <file>:: (EXPERIMENTAL)
--- a/doc/hgrc.5.txt Thu Feb 16 08:48:31 2006 -0800 +++ b/doc/hgrc.5.txt Thu Feb 16 08:51:24 2006 -0800 @@ -150,8 +150,8 @@ it is passed are listed with names of the form "$HG_foo". changegroup;; - Run after a changegroup has been added via push or pull. ID of the - first new changeset is in $HG_NODE. + Run after a changegroup has been added via push, pull or + unbundle. ID of the first new changeset is in $HG_NODE. commit;; Run after a changeset has been created in the local repository. ID of the newly created changeset is in $HG_NODE. Parent @@ -160,6 +160,10 @@ Run after a changeset has been pulled, pushed, or unbundled into the local repository. The ID of the newly arrived changeset is in $HG_NODE. + prechangegroup;; + Run before a changegroup is added via push, pull or unbundle. + Exit status 0 allows the changegroup to proceed. Non-zero status + will cause the push, pull or unbundle to fail. precommit;; Run before starting a local commit. Exit status 0 allows the commit to proceed. Non-zero status will cause the commit to fail. @@ -169,6 +173,14 @@ created. Non-zero status will cause the tag to fail. ID of changeset to tag is in $HG_NODE. Name of tag is in $HG_TAG. Tag is local if $HG_LOCAL=1, in repo if $HG_LOCAL=0. + pretxnchangegroup;; + Run after a changegroup has been added via push, pull or unbundle, + but before the transaction has been committed. Changegroup is + visible to hook program. This lets you validate incoming changes + before accepting them. Passed the ID of the first new changeset + in $NODE. Exit status 0 allows the transaction to commit. + Non-zero status will cause the transaction to be rolled back and + the push, pull or unbundle will fail. pretxncommit;; Run after a changeset has been created but the transaction not yet committed. Changeset is visible to hook program. This lets you
--- a/mercurial/commands.py Thu Feb 16 08:48:31 2006 -0800 +++ b/mercurial/commands.py Thu Feb 16 08:51:24 2006 -0800 @@ -261,7 +261,7 @@ mode) def dodiff(fp, ui, repo, node1, node2, files=None, match=util.always, - changes=None, text=False): + changes=None, text=False, opts={}): if not changes: changes = repo.changes(node1, node2, files, match=match) modified, added, removed, deleted, unknown = changes @@ -296,8 +296,8 @@ date1 = util.datestr(change[2]) diffopts = ui.diffopts() - showfunc = diffopts['showfunc'] - ignorews = diffopts['ignorews'] + showfunc = opts.get('show_function') or diffopts['showfunc'] + ignorews = opts.get('ignore_all_space') or diffopts['ignorews'] for f in modified: to = None if f in mmap: @@ -1140,7 +1140,7 @@ fns, matchfn, anypats = matchpats(repo, pats, opts) dodiff(sys.stdout, ui, repo, node1, node2, fns, match=matchfn, - text=opts['text']) + text=opts['text'], opts=opts) def doexport(ui, repo, changeset, seqno, total, revwidth, opts): node = repo.lookup(changeset) @@ -2158,13 +2158,15 @@ r = " ?:?" ui.write("%-30s %s\n" % (t, r)) -def tip(ui, repo): +def tip(ui, repo, **opts): """show the tip revision Show the tip revision. """ n = repo.changelog.tip() show_changeset(ui, repo, changenode=n) + if opts['patch']: + dodiff(ui, ui, repo, repo.changelog.parents(n)[0], n) def unbundle(ui, repo, fname, **opts): """apply a changegroup file @@ -2340,7 +2342,12 @@ [('r', 'rev', [], _('revision')), ('a', 'text', None, _('treat all files as text')), ('I', 'include', [], _('include names matching the given patterns')), - ('X', 'exclude', [], _('exclude names matching the given patterns'))], + ('p', 'show-function', None, + _('show which function each change is in')), + ('w', 'ignore-all-space', None, + _('ignore white space when comparing lines')), + ('X', 'exclude', [], + _('exclude names matching the given patterns'))], _('hg diff [-a] [-I] [-X] [-r REV1 [-r REV2]] [FILE]...')), "^export": (export, @@ -2501,7 +2508,7 @@ ('r', 'rev', '', _('revision to tag'))], _('hg tag [-r REV] [OPTION]... NAME')), "tags": (tags, [], _('hg tags')), - "tip": (tip, [], _('hg tip')), + "tip": (tip, [('p', 'patch', None, _('show patch'))], _('hg tip')), "unbundle": (unbundle, [('u', 'update', None,
--- a/mercurial/localrepo.py Thu Feb 16 08:48:31 2006 -0800 +++ b/mercurial/localrepo.py Thu Feb 16 08:51:24 2006 -0800 @@ -1345,6 +1345,9 @@ if not source: return + + self.hook('prechangegroup', throw=True) + changesets = files = revisions = 0 tr = self.transaction() @@ -1387,6 +1390,9 @@ " with %d changes to %d files%s\n") % (changesets, revisions, files, heads)) + self.hook('pretxnchangegroup', throw=True, + node=hex(self.changelog.node(cor+1))) + tr.close() if changesets > 0: