Skip to content
Snippets Groups Projects
Commit e2d87b11 authored by Eric S. Raymond's avatar Eric S. Raymond
Browse files

Second step in Mercurial support merge.

parent fb08698c
No related branches found
No related tags found
No related merge requests found
......@@ -294,7 +294,7 @@ class HgExtractor(GenericExtractor):
if arguments and type(arguments[0]) == type(()):
# Called from hg_hook function
ui, repo, self.node = arguments[0]
ui, repo, node = arguments[0]
# Extract global values from the hg configuration file(s)
self.project = ui.config('irker', 'project')
......@@ -354,15 +354,20 @@ if __name__ == "__main__":
# Determine the repository type. Default to git unless user has pointed
# us at a repo with identifiable internals.
vcs = "git"
if repository and os.path.exists(os.path.join(repository, "format")):
if repository and os.path.exists(os.path.join(repository, ".hg")):
vcs = "hg"
elif repository and os.path.exists(os.path.join(repository, "format")):
vcs = "svn"
# Someday we'll have extractors for several version-control systems
if vcs == "svn":
if repository is None or not commits:
sys.stderr.write("irkerhook: svn requires a repository and a commit.")
sys.exit(1)
extractor = SvnExtractor(sys.argv[1:])
if not commits:
commits = ['HEAD']
elif vcs == "hg":
extractor = HgExtractor(sys.argv[1:])
if not commits:
commits = ['-1']
else:
extractor = GitExtractor(sys.argv[1:])
if not commits:
......
......@@ -217,8 +217,8 @@ may have the following values:</para>
<refsect2 id="svn"><title>Subversion</title>
<para>Under Subversion, <application>irkerhook.py</application>
requires two arguments: "repository=" (the absolute pathname of the
Subversion repository) and "commit=" (the numeric revision level of
requires a --repository option with value (the absolute pathname of the
Subversion repository) and a commit argument (the numeric revision level of
the commit). The values must be the two arguments that Subversion
gives its post-commit hook. Thus, a typical invocation in the post-commit
script will look like this:</para>
......@@ -263,7 +263,14 @@ this will be fixed in the next release.</para>
<para>Under Mercurial, <application>irkerhook.py</application> can be
invoked in two ways: either as a Python hook (preferred) or as a
script. As for git, in both cases all variables may be set in the repo
script.</para>
<para>When called as a script, the hook requires a --repository option
with value (the absolute pathname of the Subversion repository) and can take a
commit argument (the Mercurial hash ID of the commit or a reference to it).
The default commit argument is '-1', designating the current tip commit.</para>
<para>As for git, in both cases all variables may be set in the repo
<filename>hgrc</filename> file in an [irker] section. Command-line
variable=value arguments are accepted but not required for script
invocation. No attempt is made to interpret an
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment