hg equivalent of git stash

Matt Mackall mpm at selenic.com
Mon Dec 12 16:55:13 CST 2011


On Tue, 2011-12-13 at 01:45 +0300, anatoly techtonik wrote:
> On Tue, Dec 13, 2011 at 1:13 AM, Matt Mackall <mpm at selenic.com> wrote:
> 
> > On Tue, 2011-12-13 at 00:40 +0300, anatoly techtonik wrote:
> > > On Mon, Dec 12, 2011 at 8:47 PM, Masklinn <masklinn at masklinn.net> wrote:
> > >
> > > > On 2011-12-12, at 18:09 , anatoly techtonik wrote:
> > > > > I am puzzled. After 'hg qref -X .', 'hg qdiff' and 'hg diff' show the
> > > > same
> > > > > info. Did I break something?
> > > > `hg qref -X` removes everything from the MQ patch, so you now have:
> > > > * A working copy in its original (dirty) state
> > > > * A completely empty applied MQ patch
> > > >
> > > > It's perfectly normal that qdiff and diff show the same output, as
> > qdiff
> > > > is the sum of the current mq patch and the current working copy diff.
> > If
> > > > the patch is empty, it is the same thing as a direct diff.
> > > >
> > >
> > > It appears that misunderstood `hg qdiff` command from the moment I first
> > > used it (and it was a while since then). =) I thought it is used to show
> > > the contents of current patch.
> >
> > The fundamental thing to understand about MQ is that an applied patch IS
> > A CHANGESET. Thus all commands that can show the diff of an existing
> > changeset will work, no special MQ-specific commands are necessary.
> >
> > So you can use:
> >
> > - hg log -vpr <rev>
> > - hg diff -c <rev>
> > - hg export <rev>
> > - hg outgoing -p
> >
> > etc..
> 
> 
> I see. They are like committed revisions when pushed.

s/like//

Disable mq while a patch is applied and consult 'hg log' to achieve
enlightenment. Provided you understand how changeset hashes are
computed, you will also understand why it's only possible to qref -e the
top-most patch or reorder unapplied patches.

-- 
Mathematics is the supreme nostalgia of our time.




More information about the Mercurial mailing list