mq: don't warn on qpush against a branch head

This commit is contained in:
Dirkjan Ochtman 2010-02-07 14:06:05 +01:00
parent 38666f1574
commit e11a173bf9
3 changed files with 60 additions and 1 deletions

View File

@ -987,7 +987,12 @@ class queue(object):
diffopts = self.diffopts()
wlock = repo.wlock()
try:
if repo.dirstate.parents()[0] not in repo.heads():
heads = []
for b, ls in repo.branchmap().iteritems():
heads += ls
if not heads:
heads = [nullid]
if repo.dirstate.parents()[0] not in heads:
self.ui.status(_("(working directory not at a head)\n"))
if not self.series:

View File

@ -42,3 +42,23 @@ hg qrefresh
echo '% tip:'
hg tip --template '{rev} {desc}\n'
echo '% qpush warning branchheads'
cd ..
hg init branchy
cd branchy
echo q > q
hg add q
hg qnew -f qp
hg qpop
echo a > a
hg ci -Ama
hg up null
hg branch b
echo c > c
hg ci -Amc
hg merge default
hg ci -mmerge
hg up default
hg log
hg qpush

View File

@ -12,3 +12,37 @@ abort: popping would remove a revision not managed by this patch queue
abort: cannot refresh a revision with children
% tip:
3 append quux
% qpush warning branchheads
popping qp
patch queue now empty
adding a
0 files updated, 0 files merged, 1 files removed, 0 files unresolved
marked working directory as branch b
adding c
created new head
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
(branch merge, don't forget to commit)
0 files updated, 0 files merged, 1 files removed, 0 files unresolved
changeset: 2:65309210bf4e
branch: b
tag: tip
parent: 1:707adb4c8ae1
parent: 0:cb9a9f314b8b
user: test
date: Thu Jan 01 00:00:00 1970 +0000
summary: merge
changeset: 1:707adb4c8ae1
branch: b
parent: -1:000000000000
user: test
date: Thu Jan 01 00:00:00 1970 +0000
summary: c
changeset: 0:cb9a9f314b8b
user: test
date: Thu Jan 01 00:00:00 1970 +0000
summary: a
applying qp
now at: qp