newbie question - recovering removed files

View: New views
3 Messages — Rating Filter:   Alert me  

newbie question - recovering removed files

by Mike Barretta :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

from some revision of a repository, i delete files from my local copy
and remove them from the repo.  if i revert to the revision prior to
the file removal, i don't get the files back.  is this expected or am
i doing something wrong?

thanks!
mike
_______________________________________________
Mercurial mailing list
Mercurial@...
http://selenic.com/mailman/listinfo/mercurial

Re: newbie question - recovering removed files

by Jim Hague-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Friday 30 Oct 2009 19:41:38 Mike Barretta wrote:
> from some revision of a repository, i delete files from my local copy
> and remove them from the repo.  if i revert to the revision prior to
> the file removal, i don't get the files back.  is this expected or am
> i doing something wrong?

It's difficult to tell without knowing exactly what commands you have used.

In general, yes, you would expect to get the files back.

$ hg init
$ echo "Hello, world" > foo
$ hg add foo
$ hg commit -m "Hello"
$ hg rm foo
$ ls
$ hg commit -m "Goodbye"
$ hg log
changeset:   1:a651a830b8dd
tag:         tip
user:        Jim Hague <jim.hague@...>
date:        Fri Oct 30 20:47:35 2009 +0000
summary:     Goodbye

changeset:   0:f799cec56212
user:        Jim Hague <jim.hague@...>
date:        Fri Oct 30 20:47:20 2009 +0000
summary:     Hello

$ hg update -r 0
1 files updated, 0 files merged, 0 files removed, 0 files unresolved
$ ls
foo

Is that what you did?
--
Jim Hague - jim.hague@...          Never trust a computer you can't lift.
_______________________________________________
Mercurial mailing list
Mercurial@...
http://selenic.com/mailman/listinfo/mercurial

Re: newbie question - recovering removed files

by Mike Barretta :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

the wrinkle i didn't mention was that i'd created a branch to contain
the revisions that i'd removed files from.

what i learned was when i do an update from one branch to another, i
need to do an hg update -C to get a clean copy

On Fri, Oct 30, 2009 at 4:51 PM, Jim Hague <jim.hague@...> wrote:

> On Friday 30 Oct 2009 19:41:38 Mike Barretta wrote:
>> from some revision of a repository, i delete files from my local copy
>> and remove them from the repo.  if i revert to the revision prior to
>> the file removal, i don't get the files back.  is this expected or am
>> i doing something wrong?
>
> It's difficult to tell without knowing exactly what commands you have used.
>
> In general, yes, you would expect to get the files back.
>
> $ hg init
> $ echo "Hello, world" > foo
> $ hg add foo
> $ hg commit -m "Hello"
> $ hg rm foo
> $ ls
> $ hg commit -m "Goodbye"
> $ hg log
> changeset:   1:a651a830b8dd
> tag:         tip
> user:        Jim Hague <jim.hague@...>
> date:        Fri Oct 30 20:47:35 2009 +0000
> summary:     Goodbye
>
> changeset:   0:f799cec56212
> user:        Jim Hague <jim.hague@...>
> date:        Fri Oct 30 20:47:20 2009 +0000
> summary:     Hello
>
> $ hg update -r 0
> 1 files updated, 0 files merged, 0 files removed, 0 files unresolved
> $ ls
> foo
>
> Is that what you did?
> --
> Jim Hague - jim.hague@...          Never trust a computer you can't lift.
> _______________________________________________
> Mercurial mailing list
> Mercurial@...
> http://selenic.com/mailman/listinfo/mercurial
>

_______________________________________________
Mercurial mailing list
Mercurial@...
http://selenic.com/mailman/listinfo/mercurial