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
878bc4a6
Commit
878bc4a6
authored
13 years ago
by
Matt Mackall
Browse files
Options
Downloads
Patches
Plain Diff
revset: add remote() predicate to lookup remote revisions
parent
6c97eb44
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/revset.py
+36
-0
36 additions, 0 deletions
mercurial/revset.py
with
36 additions
and
0 deletions
mercurial/revset.py
+
36
−
0
View file @
878bc4a6
...
...
@@ -742,6 +742,41 @@
getargs
(
x
,
0
,
0
,
_
(
"
public takes no arguments
"
))
return
[
r
for
r
in
subset
if
repo
.
_phaserev
[
r
]
==
phases
.
public
]
def
remote
(
repo
,
subset
,
x
):
"""
``remote([id], [path])``
Local revision that corresponds to the given identifier in a
remote repository, if present. Here, the
'
.
'
identifier is a
synonym for the current local branch.
"""
import
hg
# avoid start-up nasties
# i18n: "remote" is a keyword
l
=
getargs
(
x
,
0
,
2
,
_
(
"
outgoing takes one or two arguments
"
))
q
=
'
.
'
if
len
(
l
)
>
0
:
# i18n: "remote" is a keyword
q
=
getstring
(
l
[
0
],
_
(
"
remote requires a string id
"
))
if
q
==
'
.
'
:
q
=
repo
[
'
.
'
].
branch
()
dest
=
''
if
len
(
l
)
>
1
:
# i18n: "remote" is a keyword
dest
=
getstring
(
l
[
1
],
_
(
"
remote requires a repository path
"
))
dest
=
repo
.
ui
.
expandpath
(
dest
or
'
default
'
)
dest
,
branches
=
hg
.
parseurl
(
dest
)
revs
,
checkout
=
hg
.
addbranchrevs
(
repo
,
repo
,
branches
,
[])
if
revs
:
revs
=
[
repo
.
lookup
(
rev
)
for
rev
in
revs
]
other
=
hg
.
peer
(
repo
,
{},
dest
)
n
=
other
.
lookup
(
q
)
if
n
in
repo
:
r
=
repo
[
n
].
rev
()
if
r
in
subset
:
return
[
r
]
return
[]
def
removes
(
repo
,
subset
,
x
):
"""
``removes(pattern)``
Changesets which remove files matching pattern.
...
...
@@ -916,6 +951,7 @@
"
parents
"
:
parents
,
"
present
"
:
present
,
"
public
"
:
public
,
"
remote
"
:
remote
,
"
removes
"
:
removes
,
"
rev
"
:
rev
,
"
reverse
"
:
reverse
,
...
...
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