Import patches for the specified revision

nemo nemo1412 at gmail.com
Thu Dec 15 20:27:15 CST 2011


I'm developing a website on which users can browser their hg repos and
edit source codes on line, just like what github can do.

In case multi users edit the same file at the same time, I must keep my
hand off the working copy. So I need the --bypass option.

Another problem is  that while I open a source file, edit it, and then
commit my changes via the web,  someone else may have already changed
the same file and committed. So I have to commit my PATCH to its parent.
It seems this cmd can work:

hg import --bypass --exact PATCH

the problem is the PATCH format, which must start with such a head like this:

# HG changeset patch
# User nemo
# Date 1323930839 -28800
# Node ID 59cf96a481dea27dfee9cbf78666d36664d5e084
# Parent  5d47842099e6e79d8a5c8dbad9e2655d2905776d

How can I get the Node ID before I commit it?



On 12/15/2011 10:30 PM, Martin Geisler wrote:
> nemo<nemo1412 at gmail.com>  writes:
>
>> Sorry I didn't say clearly.
>>
>> I need  a -r flag for import command like this:
>>
>>      hg import -r REV PATCH
>>
>> So, I can import my PATCH to the specified revision REV, rather than
>> the recent version.
>>
>> BTW. : And I don't want to update my working directory to revision REV :)
> I see. Try using --bypass with --exact, that should do what you want: it
> applies the patch to the changeset mentioned in the patch header and
> does so without touching the working copy.


More information about the Mercurial mailing list