Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
mercurial-devel
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mercurial
mercurial-devel
Commits
bd22900e
Commit
bd22900e
authored
4 years ago
by
Matt Harbison
Browse files
Options
Downloads
Patches
Plain Diff
exthelper: update the examples to be python3 complaint
Differential Revision:
https://phab.mercurial-scm.org/D9368
parent
f177fcd9
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
mercurial/exthelper.py
+19
-19
19 additions, 19 deletions
mercurial/exthelper.py
with
19 additions
and
19 deletions
mercurial/exthelper.py
+
19
−
19
View file @
bd22900e
...
...
@@ -53,10 +53,10 @@
revsetpredicate = eh.revsetpredicate
templatekeyword = eh.templatekeyword
@eh.command(
'
mynewcommand
'
,
[(
'
r
'
,
'
rev
'
, [], _(
'
operate on these revisions
'
))],
_(
'
-r REV...
'
),
@eh.command(
b
'
mynewcommand
'
,
[(
b
'
r
'
,
b
'
rev
'
, [], _(
b
'
operate on these revisions
'
))],
_(
b
'
-r REV...
'
),
helpcategory=command.CATEGORY_XXX)
def newcommand(ui, repo, *revs, **opts):
# implementation goes here
...
...
@@ -59,8 +59,8 @@
helpcategory=command.CATEGORY_XXX)
def newcommand(ui, repo, *revs, **opts):
# implementation goes here
eh.configitem(
'
experimental
'
,
'
foo
'
,
eh.configitem(
b
'
experimental
'
,
b
'
foo
'
,
default=False,
)
...
...
@@ -64,7 +64,7 @@
default=False,
)
@eh.filesetpredicate(
'
lfs()
'
)
@eh.filesetpredicate(
b
'
lfs()
'
)
def filesetbabar(mctx, x):
return mctx.predicate(...)
...
...
@@ -68,5 +68,5 @@
def filesetbabar(mctx, x):
return mctx.predicate(...)
@eh.revsetpredicate(
'
hidden
'
)
@eh.revsetpredicate(
b
'
hidden
'
)
def revsetbabar(repo, subset, x):
...
...
@@ -72,4 +72,4 @@
def revsetbabar(repo, subset, x):
args = revset.getargs(x, 0, 0,
'
babar accept no argument
'
)
return [r for r in subset if
'
babar
'
in repo[r].description()]
args = revset.getargs(x, 0, 0,
b
'
babar accept no argument
'
)
return [r for r in subset if
b
'
babar
'
in repo[r].description()]
...
...
@@ -75,3 +75,3 @@
@eh.templatekeyword(
'
babar
'
)
@eh.templatekeyword(
b
'
babar
'
)
def kwbabar(ctx):
...
...
@@ -77,5 +77,5 @@
def kwbabar(ctx):
return
'
babar
'
return
b
'
babar
'
"""
def
__init__
(
self
):
...
...
@@ -160,7 +160,7 @@
The following operations belong here:
- Changes depending on the status of other extensions. (if
extensions.find(
'
mq
'
))
extensions.find(
b
'
mq
'
))
- Add a global option to all commands
"""
knownexts
=
{}
...
...
@@ -203,7 +203,7 @@
@eh.uisetup
def setupbabar(ui):
print
'
this is uisetup!
'
print
(
'
this is uisetup!
'
)
"""
self
.
_uicallables
.
append
(
call
)
return
call
...
...
@@ -215,7 +215,7 @@
@eh.uipopulate
def setupfoo(ui):
print
'
this is uipopulate!
'
print
(
'
this is uipopulate!
'
)
"""
self
.
_uipopulatecallables
.
append
(
call
)
return
call
...
...
@@ -227,7 +227,7 @@
@eh.extsetup
def setupcelestine(ui):
print
'
this is extsetup!
'
print
(
'
this is extsetup!
'
)
"""
self
.
_extcallables
.
append
(
call
)
return
call
...
...
@@ -239,7 +239,7 @@
@eh.reposetup
def setupzephir(ui, repo):
print
'
this is reposetup!
'
print
(
'
this is reposetup!
'
)
"""
self
.
_repocallables
.
append
(
call
)
return
call
...
...
@@ -258,5 +258,5 @@
example::
@eh.wrapcommand(
'
summary
'
)
@eh.wrapcommand(
b
'
summary
'
)
def wrapsummary(orig, ui, repo, *args, **kwargs):
...
...
@@ -262,5 +262,5 @@
def wrapsummary(orig, ui, repo, *args, **kwargs):
ui.note(
'
Barry!
'
)
ui.note(
b
'
Barry!
'
)
return orig(ui, repo, *args, **kwargs)
The `opts` argument allows specifying a list of tuples for additional
...
...
@@ -298,5 +298,5 @@
example::
@eh.function(discovery,
'
checkheads
'
)
@eh.function(discovery,
b
'
checkheads
'
)
def wrapfunction(orig, *args, **kwargs):
...
...
@@ -302,5 +302,5 @@
def wrapfunction(orig, *args, **kwargs):
ui.note(
'
His head smashed in and his heart cut out
'
)
ui.note(
b
'
His head smashed in and his heart cut out
'
)
return orig(*args, **kwargs)
"""
...
...
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