Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
irker
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
iDB
irker
Commits
e2d87b11
Commit
e2d87b11
authored
12 years ago
by
Eric S. Raymond
Browse files
Options
Downloads
Patches
Plain Diff
Second step in Mercurial support merge.
parent
fb08698c
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
irkerhook.py
+10
-5
10 additions, 5 deletions
irkerhook.py
irkerhook.xml
+10
-3
10 additions, 3 deletions
irkerhook.xml
with
20 additions
and
8 deletions
irkerhook.py
+
10
−
5
View file @
e2d87b11
...
...
@@ -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
:
...
...
This diff is collapsed.
Click to expand it.
irkerhook.xml
+
10
−
3
View file @
e2d87b11
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment