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
92455c1d6f83
Commit
92455c1d6f83
authored
16 years ago
by
Stefano Tortarolo
Browse files
Options
Downloads
Patches
Plain Diff
rebase: pull --rebase updates if there is nothing to rebase
parent
660c8dd44060
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
hgext/rebase.py
+8
-1
8 additions, 1 deletion
hgext/rebase.py
tests/test-rebase-pull
+13
-2
13 additions, 2 deletions
tests/test-rebase-pull
tests/test-rebase-pull.out
+21
-2
21 additions, 2 deletions
tests/test-rebase-pull.out
with
42 additions
and
5 deletions
hgext/rebase.py
+
8
−
1
View file @
92455c1d
...
...
@@ -400,7 +400,9 @@
'
Call rebase after pull if the latter has been invoked with --rebase
'
if
opts
.
get
(
'
rebase
'
):
if
opts
.
get
(
'
update
'
):
raise
util
.
Abort
(
_
(
'
--update and --rebase are not compatible
'
))
del
opts
.
get
[
'
update
'
]
ui
.
debug
(
_
(
'
--update and --rebase are not compatible, ignoring
'
'
the update flag
\n
'
))
cmdutil
.
bail_if_changed
(
repo
)
revsprepull
=
len
(
repo
)
...
...
@@ -408,6 +410,11 @@
revspostpull
=
len
(
repo
)
if
revspostpull
>
revsprepull
:
rebase
(
ui
,
repo
,
**
opts
)
branch
=
repo
[
None
].
branch
()
dest
=
repo
[
branch
].
rev
()
if
dest
!=
repo
[
'
.
'
].
rev
():
# there was nothing to rebase we force an update
merge
.
update
(
repo
,
dest
,
False
,
False
,
False
)
else
:
orig
(
ui
,
repo
,
*
args
,
**
opts
)
...
...
This diff is collapsed.
Click to expand it.
tests/test-rebase-pull
+
13
−
2
View file @
92455c1d
...
...
@@ -25,6 +25,9 @@
cd
..
hg clone a b
# This is needed to test pull --rebase
hg clone a c
cd
b
addcommit
"L1"
2
...
...
@@ -44,7 +47,15 @@
hg pull
--rebase
2>&1 |
sed
's/\(pulling from \).*/\1/'
echo
echo
"% Invoke pull --rebase with --update"
hg pull
--rebase
--update
echo
"% Invoke pull --rebase and nothing to rebase"
cd
../c
hg pull
--rebase
2>&1 |
sed
's/\(pulling from \).*/\1/'
hg glog
--template
'{rev}\n'
-l
1
echo
echo
"% pull --rebase doesn't update if nothing has been pulled"
hg up 1
hg pull
--rebase
2>&1 |
sed
's/\(pulling from \).*/\1/'
hg glog
--template
'{rev}\n'
-l
1
exit
0
This diff is collapsed.
Click to expand it.
tests/test-rebase-pull.out
+
21
−
2
View file @
92455c1d
updating working directory
2 files updated, 0 files merged, 0 files removed, 0 files unresolved
updating working directory
2 files updated, 0 files merged, 0 files removed, 0 files unresolved
...
...
@@ -30,5 +32,22 @@
searching for changes
no changes found
% Invoke pull --rebase with --update
abort: --update and --rebase are not compatible
% Invoke pull --rebase and nothing to rebase
pulling from
searching for changes
adding changesets
adding manifests
adding file changes
added 1 changesets with 1 changes to 1 files
(run 'hg update' to get a working copy)
nothing to rebase
@ 2
|
% pull --rebase doesn't update if nothing has been pulled
0 files updated, 0 files merged, 1 files removed, 0 files unresolved
pulling from
searching for changes
no changes found
o 2
|
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