I would be perfectly fine with a revert instead of an update.
The problem was I haven't found any Revert option in TortoiseHg.
So after the accidental update of everything, I made a copy of the folder,
updated everything back to the latest revision
and overwritten the folder from backup. That should be the same as the
Revert of the folder, right?
Is it possible to Revert in TortoiseHg ? If not, is it planned for a next
revision?
Thanks,
Tomas
On 26 June 2012 17:24, Adrian Buehlmann <[email protected]> wrote:
> On 2012-06-26 13:44, Tomáš Blaho wrote:
> > Hello,
> >
> > I would like to return back to some revision on some of my folders (just
> > for a while), using TortoiseHg 2.4.1 Win7 x64 integration.
> > So I used the TortoiseSVN way, right clicked on the folder in IE and
> > used "TortoiseHg->Revision History".
> > Then I picked up the revision I wanted, right clicked on it and used
> > "Update...".
> > That unfortunately updates everything and not just the folder I want.
> > What is the right way to do that?
>
> You can do something like that on the command line.
>
> First, you should understand that Mercurial on principle takes snapshots
> of the whole directory tree in your working directory (the directory
> that contains the .hg directory).
>
> So, when you commit, the state of the whole tree with all directories
> and files is exactly recorded as a new revision.
>
> When you update (hg update) to an older revision, all files and
> directories are set again to what they were at that revision. So there
> is no such thing as a partial update.
>
> However, you can accomplish what you want by specifying that you want to
> set some files to some other revision.
>
> This can be done with revert.
>
> For example, in a clone of the Mercurial source code repo, let's say
> I've currently updated (=all files!) to revision 17030:
>
> $ hg parents -q
> 17030:ec5ef276077f
>
> $ hg status
> <no output!>
>
> So all my files are now in the state as per revision 17030.
>
> Let's say I want to have all the files in the mercurial subdir (in that
> repo) at revision 17000. I can do that using revert:
>
> $ hg revert -r 17000 mercurial
> reverting mercurial\discovery.py
> reverting mercurial\localrepo.py
> reverting mercurial\repair.py
> reverting mercurial\revlog.py
> reverting mercurial\revset.py
> reverting mercurial\scmutil.py
> reverting mercurial\subrepo.py
> reverting mercurial\win32.py
>
> You should know that this hasn't changed the revision where I'm updated
> to. It's still 17030:
>
> $ hg parents -q
> 17030:ec5ef276077f
>
> What revert has done is merely setting those files to what they
> contained at revision 17000. But this makes these files appear as
> changed with respect to the currently checked-out revision (17030).
>
> You can see this with status:
>
> $ hg status
> M mercurial\discovery.py
> M mercurial\localrepo.py
> M mercurial\repair.py
> M mercurial\revlog.py
> M mercurial\revset.py
> M mercurial\scmutil.py
> M mercurial\subrepo.py
> M mercurial\win32.py
>
> Status reports these as modified (M).
>
> If you would commit in that state, you would create a new revision with
> these changes introduced on top of revision 17030. The new commit would
> have the files in the mercurial subdirectory in the state as of revision
> 17000.
>
> If you don't want that, you can throw away all your uncommitted changes
> by using "hg update --clean" (this will make no backup, so make sure you
> know what you do!).
>
> Or you could use revert again to set the files in the mercurial
> subdirectory to the state as per what's in the parent revision (.):
>
> $ hg revert -r . mercurial
> reverting mercurial\discovery.py
> reverting mercurial\localrepo.py
> reverting mercurial\repair.py
> reverting mercurial\revlog.py
> reverting mercurial\revset.py
> reverting mercurial\scmutil.py
> reverting mercurial\subrepo.py
> reverting mercurial\win32.py
>
> Now, hg status will show you again no changed files:
>
> $ hg status
>
> So, nothing changed compared to revision 17030.
>
> But note that the revert command will create backup files (*.orig)
> before clobbering files that have changes. If you don't want that, use
> the --no-backup option (or -C for the short version).
>
> See 'hg help revert'.
>
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Tortoisehg-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tortoisehg-discuss