Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
H
hg-windows-ci
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
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
hg-windows-ci
Commits
2160c2e0
Commit
2160c2e0
authored
11 years ago
by
Mads Kiilerich
Browse files
Options
Downloads
Patches
Plain Diff
rebase: refactor and rename checkexternal - it is a getter more than a setter
parent
427ce563
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
hgext/rebase.py
+13
-11
13 additions, 11 deletions
hgext/rebase.py
with
13 additions
and
11 deletions
hgext/rebase.py
+
13
−
11
View file @
2160c2e0
...
...
@@ -259,7 +259,7 @@
if
collapsef
:
targetancestors
=
repo
.
changelog
.
ancestors
([
target
],
inclusive
=
True
)
external
=
check
external
(
repo
,
state
,
targetancestors
)
external
=
external
parent
(
repo
,
state
,
targetancestors
)
if
keepbranchesf
:
# insert _savebranch at the start of extrafns so if
...
...
@@ -388,7 +388,8 @@
finally
:
release
(
lock
,
wlock
)
def
checkexternal
(
repo
,
state
,
targetancestors
):
"""
Check whether one or more external revisions need to be taken in
consideration. In the latter case, abort.
def
externalparent
(
repo
,
state
,
targetancestors
):
"""
Return the revision that should be used as the second parent
when the revisions in state is collapsed on top of targetancestors.
Abort if there is more than one parent.
"""
...
...
@@ -394,6 +395,6 @@
"""
external
=
nullrev
parents
=
set
()
source
=
min
(
state
)
for
rev
in
state
:
if
rev
==
source
:
continue
...
...
@@ -396,8 +397,7 @@
source
=
min
(
state
)
for
rev
in
state
:
if
rev
==
source
:
continue
# Check externals and fail if there are more than one
for
p
in
repo
[
rev
].
parents
():
if
(
p
.
rev
()
not
in
state
and
p
.
rev
()
not
in
targetancestors
):
...
...
@@ -401,11 +401,13 @@
for
p
in
repo
[
rev
].
parents
():
if
(
p
.
rev
()
not
in
state
and
p
.
rev
()
not
in
targetancestors
):
if
external
!=
nullrev
:
raise
util
.
Abort
(
_
(
'
unable to collapse, there is more
'
'
than one external parent
'
))
external
=
p
.
rev
()
return
external
parents
.
add
(
p
.
rev
())
if
not
parents
:
return
nullrev
if
len
(
parents
)
==
1
:
return
parents
.
pop
()
raise
util
.
Abort
(
_
(
'
unable to collapse, there is more
'
'
than one external parent
'
))
def
concludenode
(
repo
,
rev
,
p1
,
p2
,
commitmsg
=
None
,
editor
=
None
,
extrafn
=
None
):
'
Commit the changes and store useful information in extra
'
...
...
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