English 中文(简体)
撤销对特定保留的保留
原标题:Rolling Back Repository to specific Revission

I have a problem with a repository. I pulled a a list of changesets from another repository, ran the update and merged... The merge didn t work as expected and now I need to roll back to before I pulled the changesets just to pull them again.

我怎么能够把不止一次的改动变成具体的修订?

最佳回答

如果通过“退税”,你就意味着要像你从未拉过的那样摆脱变化,那么你就可以利用MQ延伸部分的“简易”功能。

First enable the MQ extension by editing your .hgrc (*nix) or mercurial.ini (Windows) file:

[extensions]
mq=

Then use the strip command:

hg strip REV

Warning: This will remove the changeset with the given revision hash, and any changesets that follows from that. If you re unsure about what you want to accomplish or how to use the command, make a clone of the repository before you try it, that way you can safely experiment.

还指出,如果你已经把你合并到其他地方,你也可以清理到该存放处,视该合并是否“在野中”而定,可能无法永久清除。

问题回答

<>Rollback是你重新描述的。 如果在拉回你回来之前,你会这样做:

[A]-[B]-[C]-[D]

and after the pull it looked like:

[A]-[B]-[C]-[D]
          
           -[E]-[F]

在合并后,委员会也认为:

[A]-[B]-[C]-[D]-----[G]
                  /
           -[E]-[F]

那么,你不想 un——你仍然想要改变E和F——你只是想在G.的合并中再做一次尝试。

这方面有几个办法。 The most Mercurial way to do that is to Just do:

hg update D
hg merge E
... re-merge, doing it better this time ...
hg commit # creates H

之后,你们的历史将看一看:

[A]-[B]-[C]-[D]-------- [G]
                    X
           -[E]-[F]-----[H]

在X是过境点的地方。 然后,你将H用作新的发展点,忽视(或接近G)。

其次,它最好去除G,然后重新处理这一合并。 这样做的官方途径是把贵处的存放处带给当地,除G之类外,其他一切照样:

cd ..
hg clone -r tip-1 myrepo mynewrepo

在座各位,除G外,别无其他东西。 然后,你可以重新合并。 护堤也起作用,但因某种原因致残。

底线是,你不需要去除并照搬这支拖拉机;只是merge。

I haven t really used mercurial, only really CVS and SVN, but it should be the same. I m presuming that you can checkout an older version based on the revision number or date, correct? If so, check out the older version in a temporary directory and re-merge that. You will need to delete any new files added in the repository though as well. That way you should effectively have the same copy of the files as 2 or more revisions ago.

This will have the same effect as rolling back, though it will be a higher revision number. The same contents, just a newer revision. I think this is the safest way to do it, as there s no way of loosing anything.

If you want to return to a specific revision and discard all local changes, you can simply update to the revision and pass the clean flag:

hg up -C -R 7

这一行文排除了未经许可的改动,并重述了作为实例的修改7。





相关问题
Tracking Versions, Builds, Revisions, with TortiseSVN

I am the sole developer on a project and have been using tortoiseSVN for quite a while. Now Id like to start getting version information working correctly in the project I.E. show Major Version, Minor ...

Tips on upgrading CVS to git/hg?

We still use CVS, I use git and hg for my personal use though I m still a novice at both, but I realize they re much more modern and better, faster, distributed, etc. It s just everyone is so ...

How to handle different csproj [closed]

I am working in a team of five. We are working on a C# application with five csprojects. The problem is that for each csproject, each of my colleagues has their own ideas on how to reference a DLL; ...

Changing username in SVN+SSH URI on the fly in working copy

I am using SVN+SSH to check out a working copy of repository from an SVN server on which all developers are members of a developer group and have full read/write permissions on the repository ...

How to search for file in subversion server?

Is there a way to search for a file in a subversion repository? Something similar to Unix find command, with which I can find the location of a file in a repository. I know there is svn list, but ...

热门标签