问题描述:

I've been reading various tutorials on how to use Mercurial, and have been trying to create a patch containing my changes using hg qnew (e.g. hg qnew Enumpatch.patch). However it just keeps coming up with an empty patch. I've tried reading around and googling and am none the wiser. I think it's probably something really obvious. Can anyone help me?

When I do hg status I get:

$ hg status

M series

A Enum

so it can't see the changes I have done previously. Is there a way of rectifying this?

I'm doing the following steps on Mercurial:

$ echo >FormAssistPopup.java

$ hg add FormAssistPopup.java

FormAssistPopup.java already tracked!

$ hg commit -m "Enum patch."

abort: cannot commit over an applied mq patch

$ hg qnew Enum.patch

Enum.patch already tracked!

It won't let me commit over an applied patch, but when I try and create a new patch it says 'patch already tracked', despite the fact it has been removed from the patches folder and from the series file. Is there any way round this?

网友答案:

There isn't enough information to really know what you are doing wrong, but here's the basic sequence to create a patch. Perhaps that will help:

Make a repository:

hg init example
cd example

Commit a file to it:

echo >file1
hg add file1
hg commit -m "First file."

Make some changes:

echo >>file1
echo >file2
hg add file2

Create the patch:

hg qnew mypatch

Make another change:

echo >>file2

Update the current patch:

hg qrefresh

Make another change:

echo >>file1
echo >>file2

Start a new patch:

hg qnew Patch2

Remove the most recent patch:

hg qpop
相关阅读:
Top