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
84d4a4ce45fd
Commit
84d4a4ce45fd
authored
13 years ago
by
Matt Mackall
Browse files
Options
Downloads
Patches
Plain Diff
rebase: simplify set generation
parent
6cb6064f1d50
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
hgext/rebase.py
+12
-25
12 additions, 25 deletions
hgext/rebase.py
with
12 additions
and
25 deletions
hgext/rebase.py
+
12
−
25
View file @
84d4a4ce
...
...
@@ -15,7 +15,7 @@
'''
from
mercurial
import
hg
,
util
,
repair
,
merge
,
cmdutil
,
commands
,
bookmarks
from
mercurial
import
extensions
,
patch
,
scmutil
from
mercurial
import
extensions
,
patch
from
mercurial.commands
import
templateopts
from
mercurial.node
import
nullrev
from
mercurial.lock
import
release
...
...
@@ -184,21 +184,9 @@
else
:
dest
=
repo
[
destf
]
rebaseset
=
None
if
srcf
:
revsetargs
=
(
'
(%r)::
'
,
srcf
)
elif
revf
:
rebaseset
=
scmutil
.
revrange
(
repo
,
revf
)
if
not
keepf
and
rebaseset
:
try
:
repo
.
set
(
'
children(%ld) - %ld
'
,
rebaseset
,
rebaseset
).
next
()
except
StopIteration
:
pass
# empty revset is what we look for
else
:
msg
=
_
(
"
can
'
t remove original changesets with
"
"
unrebased descendants
"
)
hint
=
_
(
'
use --keep to keep original changesets
'
)
raise
util
.
Abort
(
msg
,
hint
=
hint
)
if
revf
:
revgen
=
repo
.
set
(
'
%lr
'
,
revf
)
elif
srcf
:
revgen
=
repo
.
set
(
'
(%r)::
'
,
srcf
)
else
:
base
=
basef
or
'
.
'
...
...
@@ -203,12 +191,11 @@
else
:
base
=
basef
or
'
.
'
revsetargs
=
(
'
(children(ancestor(%r, %d)) and ::(%r))::
'
,
base
,
dest
,
base
)
if
rebaseset
is
None
:
rebaseset
=
[
c
.
rev
()
for
c
in
repo
.
set
(
*
revsetargs
)]
if
rebaseset
:
result
=
buildstate
(
repo
,
dest
,
rebaseset
,
detachf
)
else
:
revgen
=
repo
.
set
(
'
(children(ancestor(%r, %d)) and ::(%r))::
'
,
base
,
dest
,
base
)
rebaseset
=
[
c
.
rev
()
for
c
in
revgen
]
if
not
rebaseset
:
repo
.
ui
.
debug
(
'
base is ancestor of destination
'
)
result
=
None
if
not
result
:
...
...
@@ -581,7 +568,7 @@
if
commonbase
==
dest
:
samebranch
=
root
.
branch
()
==
dest
.
branch
()
if
samebranch
and
root
in
dest
.
children
():
repo
.
ui
.
debug
(
_
(
'
source is a child of destination
'
)
)
repo
.
ui
.
debug
(
'
source is a child of destination
'
)
return
None
# rebase on ancestor, force detach
detach
=
True
...
...
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