Bug 2849 - mq series loses order after rebase
Summary: mq series loses order after rebase
Status: RESOLVED FIXED
Alias: None
Product: Mercurial
Classification: Unclassified
Component: mq (show other bugs)
Version: unspecified
Hardware: All All
: normal bug
Assignee: Bugzilla
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-06-12 08:16 UTC by Idan Kamara
Modified: 2012-06-01 04:52 UTC (History)
6 users (show)

See Also:
Python Version: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Idan Kamara 2011-06-12 08:16 UTC
test script follows (basically test-rebase-mq.t with 'hg qseries' before and 
after rebase):

  $ cat >> $HGRCPATH <<EOF
  > [extensions]
  > graphlog=
  > rebase=
  > mq=
  > 
  > [mq]
  > plain=true
  > 
  > [alias]
  > tglog = log -G --template "{rev}: '{desc}' tags: {tags}\n"
  > EOF

Rebase with guards

  $ hg init foo
  $ cd foo
  $ echo a > a
  $ hg ci -Am a
  adding a

Create mq repo with guarded patches foo and bar:

  $ hg qnew foo
  $ hg qguard foo +baz
  $ echo foo > foo
  $ hg qref
  $ hg qpop
  popping foo
  patch queue now empty

  $ hg qnew bar
  $ hg qguard bar +baz
  $ echo bar > bar
  $ hg qref

  $ hg qguard -l
  bar: +baz
  foo: +baz

  $ hg tglog
  @  1:* '[mq]: bar' tags: bar qbase qtip tip (glob)
  |
  o  0:* 'a' tags: qparent (glob)
  
Create new head to rebase bar onto:

  $ hg up -C 0
  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
  $ echo b > b
  $ hg add b
  $ hg ci -m b
  created new head
  $ hg up -C 1
  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
  $ echo a >> a
  $ hg qref

  $ hg tglog
  @  2:* '[mq]: bar' tags: bar qbase qtip tip (glob)
  |
  | o  1:* 'b' tags: (glob)
  |/
  o  0:* 'a' tags: qparent (glob)
  

Rebase bar (make sure series order is preserved):

  $ hg qseries
  bar
  foo

  $ hg -q rebase -d 1
  $ hg qseries
  foo
  bar

  $ hg qguard -l
  foo: +baz
  bar: +baz
Comment 1 HG Bot 2011-06-13 14:00 UTC
Fixed by http://selenic.com/repo/hg/rev/b28004513977
Idan Kamara <idankk86@gmail.com>
rebase: preserve mq series order after rebasing (issue2849)

(please test the fix)
Comment 2 Lars Westerhoff 2012-03-23 07:40 UTC
The following test fails for me with 2.1.1+27-900eee0778d1. Basically, all
unapplied guarded patches below applied unguarded patches are moved to the
end of series due to the rebase.

(I hope it was okay to re-open this bug instead of submitting a new one,
since it seems to be the same issue.)

  $ cat >> $HGRCPATH <<EOF
  > [extensions]
  > graphlog=
  > rebase=
  > mq=
  > 
  > [mq]
  > plain=true
  > 
  > [alias]
  > tglog = log -G --template "{rev}: '{desc}' tags: {tags}\n"
  > EOF

Rebase with guards

  $ hg init foo
  $ cd foo
  $ echo a > a
  $ hg ci -Am a
  adding a

Create mq repo with guarded patch foo and unguarded bar:

  $ hg qnew foo
  $ echo foo > foo
  $ hg qref
  $ hg qnew bar
  $ echo bar > bar
  $ hg qref
  $ hg qpop -a
  popping bar
  popping foo
  patch queue now empty
  $ hg qguard foo +baz
  $ hg qguard -l
  foo: +baz
  bar: unguarded
  $ hg qpush -a
  applying bar
  patch bar is empty
  now at: bar
  $ hg tglog
  @  1: 'imported patch bar' tags: bar qbase qtip tip
  |
  o  0: 'a' tags: qparent
  
Create new head to rebase bar onto:

  $ hg up -C 0
  0 files updated, 0 files merged, 0 files removed, 0 files unresolved
  $ echo b > b
  $ hg add b
  $ hg ci -m b
  created new head
  $ hg up -C 1
  0 files updated, 0 files merged, 1 files removed, 0 files unresolved
  $ echo a >> a
  $ hg qref

  $ hg tglog
  @  2:* '[mq]: bar' tags: bar qbase qtip tip (glob)
  |
  | o  1:* 'b' tags: (glob)
  |/
  o  0:* 'a' tags: qparent (glob)
  

Rebase bar (make sure series order is preserved):

  $ hg qseries
  foo
  bar

  $ hg -q rebase -d 1
  $ hg qseries
  foo
  bar

  $ hg qguard -l
  foo: +baz
  bar: unguarded
Comment 3 Patrick Mézard 2012-04-25 09:13 UTC
Fix submitted here:

  http://selenic.com/pipermail/mercurial-devel/2012-April/039487.html

Thanks for the report!
Comment 4 Lars Westerhoff 2012-04-25 10:08 UTC
The patch seems to work for me. Thank you.
Comment 5 HG Bot 2012-04-27 12:00 UTC
Fixed by http://selenic.com/repo/hg/rev/b9f51f49bf2a
Patrick Mezard <patrick@mezard.eu>
rebase: preserve mq series order, guarded patches (issue2849)

(please test the fix)
Comment 6 Bugzilla 2012-05-12 09:20 UTC

--- Bug imported by bugzilla@serpentine.com 2012-05-12 09:20 EDT  ---

This bug was previously known as _bug_ 2849 at http://mercurial.selenic.com/bts/issue2849

Bug Status was UNCONFIRMED but everconfirmed was true
   Setting status to CONFIRMED