Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
evolve
Manage
Activity
Members
Labels
Code
Merge requests
30
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
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
evolve
Merge requests
!130
topic: compat with tr.changes[b'phases'], it's now a list
Code
Review changes
Check out branch
Download
Patches
Plain diff
Closed
topic: compat with tr.changes[b'phases'], it's now a list
topic/default/phases-revranges
into
branch/default
Overview
0
Commits
1
Pipelines
1
Changes
1
Closed
Anton Shestakov
requested to merge
topic/default/phases-revranges
into
branch/default
4 years ago
Overview
0
Commits
1
Pipelines
1
Changes
1
Expand
👍
0
👎
0
Merge request reports
Compare
branch/default
branch/default (base)
and
latest version
latest version
d7f87c7c
1 commit,
4 years ago
1 file
+
13
−
4
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
hgext3rd/topic/flow.py
+
13
−
4
Options
@@ -7,6 +7,7 @@ from mercurial import (
extensions
,
node
,
phases
,
util
,
)
from
mercurial.i18n
import
_
@@ -62,10 +63,18 @@ def rejectuntopicedchangeset(repo, tr):
def
reject_publish
(
repo
,
tr
):
"""
prevent a transaction to be publish anything
"""
published
=
set
()
for
r
,
(
o
,
n
)
in
tr
.
changes
[
b
'
phases
'
].
items
():
if
n
==
phases
.
public
:
published
.
add
(
r
)
if
util
.
safehasattr
(
tr
.
changes
[
b
'
phases
'
],
'
items
'
):
# hg <= 5.3 (fdc802f29b2c)
published
=
{
r
for
r
,
(
o
,
n
)
in
tr
.
changes
[
b
'
phases
'
].
items
()
if
n
==
phases
.
public
}
else
:
revranges
=
[
r
for
r
,
(
o
,
n
)
in
tr
.
changes
[
b
'
phases
'
]
if
n
==
phases
.
public
]
published
=
{
r
for
revrange
in
revranges
for
r
in
revrange
}
if
published
:
r
=
min
(
published
)
msg
=
b
"
rejecting publishing of changeset %s
"
%
repo
[
r
]
Loading