hg equivalent of git stash

anatoly techtonik techtonik at gmail.com
Mon Dec 12 10:33:43 CST 2011


On Mon, Dec 12, 2011 at 7:28 PM, Masklinn <masklinn at masklinn.net> wrote:

> On 2011-12-12, at 17:13 , anatoly techtonik wrote:
> > On Mon, Dec 12, 2011 at 6:35 PM, Masklinn <masklinn at masklinn.net> wrote:
> >> On 2011-12-12, at 16:15 , anatoly techtonik wrote:
> >>> Quoting http://markmail.org/message/lglewvoffuxnffbz
> >>> On Jan 12, 2008 3:27:01 pm, Matt Mackall wrote:
> >>>> On Sat, 2008-01-12 at 17:13 -0600, Phillip Koebbe wrote:
> >>>>> I was reading earlier today about "git stash" and was thinking it
> >>>>> would be very useful to me. Is something like that available in hg?
> >>>> You might be interested in mq, which is about a million times more
> >>>> useful.
> >>> Among million use cases for mq, can anybody explain the mq equivalent
> of
> >>> git stash?
> >>>
> >>> My use case: I want to put my current changes away temporarily (into
> >>> stash), do some unrelated changes, commit them and then get my previous
> >>> changes back (removing them from stash). How do I do this with mq?
> >>
> >>> hg qnew -f [-i] [-m "reminder message"] some-patch-name [files…]
> >>> hg qpop
> >>
> > 'hg diff' doesn't show anything, so this solution is either wrong or
> > incomplete (thanks for the answer, I appreciate it, but it doesn't help
> > people who will be searching for 'git stash' recipe for mercurial).
> Wouldn't `hg diff` not showing anything be *the whole point* of stashing
> stuff? The two commands above result in shelving data, not in unshelving it.


The whole point of stashing stuff is to restore it later in the same form.
With 'hg qnew/qpop/qpush` I can't get my changes back. After I do 'hg
push', 'hg diff/st' is empty.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://selenic.com/pipermail/mercurial/attachments/20111212/9ccfb2b9/attachment.html>


More information about the Mercurial mailing list