tags:

views:

73

answers:

3

Turns out there is no hg qfold -a.

I tried hg qfold $(hg qunapp) and hg qunapp | xargs hg qfold but couldn't get it to work. Any ideas?

+1  A: 

Hmm... we could add a -a flag... But until we do, I would use the histedit or collapse extensions or maybe just do it myself:

$ hg update qparent
$ hg revert --all --rev qtip
$ hg commit -m 'Everything in one commit'
$ hg qpop -a

You then need to remove the patches -- perhaps you can just remove .hg/patches entirely, or you can delete some of them and edit .hg/patches/series to match.

Martin Geisler
Or use `hg qdelete`?
shambulator
shambulator: I did not suggest `hg qdelete` since it also lacks a `-a` flag.
Martin Geisler
Ah! Good reason!
shambulator
So maybe we need to add two `-a` flags :)
Martin Geisler
A: 

With your xargs approach, did you remember that qfold only folds unapplied patches into an applied patch? This worked for me (Windows) to fold all patches into the first patch:

hg qpop -a    # remove all patches
hg qpush      # apply first one
for /f %i in ('hg qunapplied') do hg qfold %i  # fold remaining patches
Mark Tolonen
A: 
hg qunapp | xargs -I'{}' hg qfold '{}'
asv