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
10a0ae66
Commit
10a0ae66
authored
11 years ago
by
durin42
Browse files
Options
Downloads
Patches
Plain Diff
histedit: refuse to edit history that contains merges (issue3962)
parent
32e502b2
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
hgext/histedit.py
+2
-0
2 additions, 0 deletions
hgext/histedit.py
tests/test-histedit-obsolete.t
+15
-0
15 additions, 0 deletions
tests/test-histedit-obsolete.t
with
17 additions
and
0 deletions
hgext/histedit.py
+
2
−
0
View file @
10a0ae66
...
...
@@ -679,6 +679,8 @@
if
(
not
obsolete
.
_enabled
and
repo
.
revs
(
'
(%ld::) - (%ld)
'
,
ctxs
,
ctxs
)):
raise
util
.
Abort
(
_
(
'
cannot edit history that would orphan nodes
'
))
if
repo
.
revs
(
'
(%ld) and merge()
'
,
ctxs
):
raise
util
.
Abort
(
_
(
'
cannot edit history that contains merges
'
))
root
=
ctxs
[
0
]
# list is already sorted by repo.set
if
not
root
.
phase
():
raise
util
.
Abort
(
_
(
'
cannot edit immutable changeset: %s
'
)
%
root
)
...
...
This diff is collapsed.
Click to expand it.
tests/test-histedit-obsolete.t
+
15
−
0
View file @
10a0ae66
...
...
@@ -441,4 +441,19 @@
|
o 0:cb9a9f314b8b (public) a
$ hg co 18
0 files updated, 0 files merged, 2 files removed, 0 files unresolved
$ echo wat >> wat
$ hg add wat
$ hg ci -m
'
add
wat
'
created new head
$ hg merge 19
2 files updated, 0 files merged, 0 files removed, 0 files unresolved
(branch merge, don
'
t
forget
to
commit
)
$
hg
ci
-
m 'merge'
$
echo
not
wat
>
wat
$
hg
ci
-
m 'modify wat'
$
hg
histedit
17
abort:
cannot
edit
history
that
contains
merges
[
255
]
$
cd
..
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