Help: removed files

1 view
Skip to first unread message

Moritz Stefaner

unread,
Mar 10, 2010, 2:53:22 PM3/10/10
to Murky
Hi,

I accidentally clicked "remove" on files with local modifications I
wanted to keep, but did not commit yet. The files with their local
modifications were immediately deleted from my hard disk. Is there any
way to restore them? Quick help appreciated, otherwise I am looking at
some serious loss of code here :(

Michael Hanna

unread,
Mar 11, 2010, 3:17:21 PM3/11/10
to murk...@googlegroups.com
Try a 'hg revert -n' at the command-line and see if those files will come back. if it looks good, do it without the '-n'

Michael


--
---------------------------------------------------------------------------
M U R K Y
http://groups.google.com/group/murky-app
To unsubscribe: mailto:murky-app+...@googlegroups.com
---------------------------------------------------------------------------

Jens Alfke

unread,
Mar 12, 2010, 2:08:57 AM3/12/10
to murk...@googlegroups.com

On Mar 10, 2010, at 11:53 AM, Moritz Stefaner wrote:

> Quick help appreciated, otherwise I am looking at some serious loss of code here :(

Sorry about the delay in posting; a new member's first post goes into the moderation queue and I'm sometimes lax about checking it (because 90% of the time it's spam.)

For general Mercurial issues like this one, it's best to ask on one of the Mercurial mailing lists at selenic.com. Murky itself doesn't touch your files; it just issues 'hg' commands behind the scenes.

—Jens

Jonathan Lundell

unread,
Mar 11, 2010, 12:47:48 PM3/11/10
to murk...@googlegroups.com
On Mar 10, 2010, at 11:53 AM, Moritz Stefaner wrote:

I ran into a similar problem the other day. Fortunately I had a backup (thank you, Time Machine). In my case, I had mistakenly assumed I was removing the files from source control, not from the disk. Silly me.

Considering the nature of a source-control system, it'd be a lot nicer if removed files were moved to the Trash rather than deleted.

Jens Alfke

unread,
Mar 12, 2010, 2:16:10 AM3/12/10
to murk...@googlegroups.com

On Mar 11, 2010, at 9:47 AM, Jonathan Lundell wrote:

> I ran into a similar problem the other day. Fortunately I had a backup (thank you, Time Machine). In my case, I had mistakenly assumed I was removing the files from source control, not from the disk. Silly me.

That's the default behavior of "hg rm". According to the help text, the flag "-Af" can be used to schedule deletion from the next revision without touching the files in the working tree, but Murky doesn't send any custom flags.

> Considering the nature of a source-control system, it'd be a lot nicer if removed files were moved to the Trash rather than deleted.

Murky itself doesn't do anything to your files; it just tells Mercurial to. There may be a way to write a Mercurial extension that would do this.

In any case, you can always use "hg revert" to undo the removal (although you'd lose any changes you'd made to the file since the last commit.)

—Jens

Moritz Stefaner

unread,
Mar 30, 2010, 3:31:13 AM3/30/10
to Murky
Hi,

thanks for the replies!

On Mar 12, 9:16 am, Jens Alfke <j...@mooseyard.com> wrote:
> On Mar 11, 2010, at 9:47 AM, Jonathan Lundell wrote:
>
> > I ran into a similar problem the other day. Fortunately I had a backup (thank you, Time Machine). In my case, I had mistakenly assumed I was removing the files from source control, not from the disk. Silly me.
>
> That's the default behavior of "hg rm". According to the help text, the flag "-Af" can be used to schedule deletion from the next revision without touching the files in the working tree, but Murky doesn't send any custom flags.

Yes, upon further reading I realized that too. It might be an idea to
offer an option in the alert box confirming the removal to keep the
files.

>
> > Considering the nature of a source-control system, it'd be a lot nicer if removed files were moved to the Trash rather than deleted.
>
> Murky itself doesn't do anything to your files; it just tells Mercurial to. There may be a way to write a Mercurial extension that would do this.
>
> In any case, you can always use "hg revert" to undo the removal (although you'd lose any changes you'd made to the file since the last commit.)

That does not help in my case, since the files were not added to the
repository yet...

Jens Alfke

unread,
Mar 30, 2010, 11:52:47 AM3/30/10
to murk...@googlegroups.com

On Mar 30, 2010, at 12:31 AM, Moritz Stefaner wrote:

> Yes, upon further reading I realized that too. It might be an idea to
> offer an option in the alert box confirming the removal to keep the
> files.

Good idea. Since there’s already an alert popping up, adding a checkbox to it doesn’t increase the overhead for the user.
I’m unlikely to get around to implementing this, but if you file a bug report it’ll be remembered and maybe someone else (you?) will do it.

—Jens

Reply all
Reply to author
Forward
0 new messages