Issue1574

Title rebase of git-style MQ patches loses --git
Priority bug Status resolved
Superseder Nosy List astratto, djc, jcoomes, keramida
Assigned To astratto Topics mq, rebase

Created on 2009-03-26.15:20:56 by keramida, last changed 2009-04-04.11:14:22 by astratto.

Files
File name Uploaded Type Edit Remove
issue1574.c2ecaf63bade.diff keramida, 2009-03-27.02:07:44 text/x-diff
rebase-mq.patch keramida, 2009-03-26.15:20:55 application/octet-stream
Messages
msg8985 (view) Author: astratto Date: 2009-04-04.11:14:20
Fixed in c3d4ff03ec72
msg8970 (view) Author: astratto Date: 2009-04-02.19:12:45
Patch sent in ml.
http://permalink.gmane.org/gmane.comp.version-control.mercurial.devel/21386
msg8962 (view) Author: astratto Date: 2009-04-01.20:02:26
I'm not sure we want to deal with defaults about mq in rebase.

Ideally it would be great to have a way to detect the format of the current
patch before qfinish it, and then use it when qimport-ing it. This way we could
solve both this issue and the mixed styles one.
That piece of code would change in something like:
    repo.mq.qimport(repo, (), patchname=mqrebase[rev],
          git=revgitformat,rev=[str(state[rev])])
where revgitformat has been computed before the line
    repo.mq.finish(repo, mqrebase.keys())
msg8914 (view) Author: keramida Date: 2009-03-27.02:07:44
I'm attaching a first cut at fixing this.  The issue1574.c2ecaf63bade.diff
patch applies cleanly on crew:c2ecaf63bade and it refreshes patches in
git-style format when rebased.

The only tricky bit is that *all* patches are refreshed in git-style when
"[defaults] qrefresh = --git" or "[defaults] qimport = --git".  This may
still be a bit surprising if there is a "mixed" patch queue with both
plain style and git-style patches.

I'm not sure I grok all the internals of MQ enough to parse the existing
patches before updatemq() runs repo.mq.finish() on them.  Reading the
patches before unregistering them, and then using git=True only for those
that already had it would probably be a slightly better way of refreshing
rebased patches.
msg8912 (view) Author: keramida Date: 2009-03-26.15:20:55
When git-style MQ patches are rebased, the rebase extension loses
the --git option, even when defaults.qrefresh includes --git.

The attached patch modifies test-rebase-mq to run a test with
this sort of MQ patch, and test-rebase-mq.out with the expected
output.  It should fail to run on crew:c2ecaf63bade though.
History
Date User Action Args
2009-04-04 11:14:22astrattosetstatus: in-progress -> resolved
nosy: keramida, djc, jcoomes, astratto
messages: + msg8985
2009-04-02 19:12:57astrattosetnosy: keramida, djc, jcoomes, astratto
messages: + msg8970
2009-04-01 21:45:19astrattosetstatus: chatting -> in-progress
assignedto: astratto
nosy: keramida, djc, jcoomes, astratto
2009-04-01 20:02:43astrattosetnosy: keramida, djc, jcoomes, astratto
messages: + msg8962
2009-03-30 23:26:00jcoomessetnosy: + jcoomes
2009-03-27 02:07:48keramidasetfiles: + issue1574.c2ecaf63bade.diff
status: unread -> chatting
messages: + msg8914
nosy: keramida, djc, astratto
2009-03-26 15:20:56keramidacreate