ironbelly

Deleted branch and now all local files are gone?

9 posts in this topic

We just deleted a branch from plastic and now all of the files that were part of that branch locally are gone.. not in the recycle bin but I am not prepared to believe that plastic would do something as stupid as to permanently delete the local files if someone deletes a branch.  Assuming the files are either hidden locally somewhere or on the server, so any help would be appreciated here

Share this post


Link to post
Share on other sites

No, deleting a branch has nothing to do with local files.

 

In fact, branches must be empty (no changesets) to be deleted... so, no relation with possible local files.

 

Now, if you deleted the active branch in your workspace, chances are Plastic switched you to the parent branch.

 

Plastic will never switch you to a different branch if there are local changes, unless you decided to bypass that behavior with a setting in preferences, something I don't think will be the case.

 

Even in the worse case (suppose Plastic has to overwrite files to put you on a different branch), it never actually deletes your workspace files, it would simply rename them to .private. But I don't think this will be the case.

 

Just to summarize: no, Plastic does not delete local files if you delete a branch. Delete a branch is a server operation. Workspaces are related to client operations.

 

Thanks,

 

pablo

 

Share this post


Link to post
Share on other sites

Thanks for the reply.

The situation is that we created a branch as a child of the wrong branch by mistake, added files to that branch and submitted. Realizing our mistake we wanted to delete this branch, and make a new one as the child of main.

So the logical course of action was to just delete this branch, make a new one properly and recommit the files. So we went to delete the branch, were confront with the 'can't delete branch with changesets error' message and then went on to delete the changesets. Once deleted we then deleted the branch.

After that was done we created the new branch and then went to re-add and re-submit the files and low and behold they were gone. This alone seems insane, as why would it delete the local files when all we did was delete the changesets and the branch, which I would assume at most are server operations. But then I realized that we had to back out of the current change set to delete it, so by going back to the changeset before we added/checkin the files it probably removed them locally in the current workspace.    This is very bad as it appears that when doing something like this, or switching workspace plastic isn't storing or caching anything locally at all it is flat out deleting it because our next thought was that there would be NO way that plastic would permanently delete the files locally, worst case scenario it would just send them to the recycling bin. So we went to check there but the files are no where to be found.

 

Share this post


Link to post
Share on other sites

Well, so:

 

* You created a changeset.

* You deleted it.

* You switched to a different branch.

 

Well, yes, then you deleted your changes. Plastic probably warned you like 3 times before doing that :-(

 

Suppose this scenario:

* You are working on branch main/task001

* You decide to move to main

* It is correct that Plastic deletes the files you added in main/task001 locally to move you to main, correct?

Well, this is what you did.

 

You can delete the changeset from a workspace that is not in task001 => if that's the case, there is no way to "keep" those files.

 

Now, we could add a case to say: if you delete the changeset currently loaded in the workspace, then go and switch to the parent one, but keep the files unchanged. We don't have support for this case.

 

You know we have a feature to "move changesets" to a different branch, that could probably have served you well here.

Needless to say I personally dislike "delete changeset" and I think it is a really bad option to have, but you know, users didn't stop till it was added.

 

Are you using Jet? If so, we can probably recover your actual data because it will not be really deleted from the database... but we would need you to send us your data for that. You should contact support.

 

pablo

 

 

Share this post


Link to post
Share on other sites

I have also concluded that I need to go into the server and try to pull this changeset out of the blobs.dat file.  I did a test where I added 10 MB worth of data to the repo, then backed out of that changeset and deleted it and on the server the repo size didn't go down at all.. So this leaves me to understand that even though we lost it locally and what not the files are still sitting there on the server.

Quote

Well, yes, then you deleted your changes. Plastic probably warned you like 3 times before doing that :-(

It simply asked for confirmation, I didn't comprehend the weight of our actions here, specifically switching to the previous changeset causing the local files to be permenantly deleted.  My assumption, which is painfully wrong, is that plastic would keep a local cache of these types of things to prevent things like this or things like having to redownload entire branches every time you switch instead of simply loading branches from the cache when you switch.

 

Quote

Suppose this scenario:

* You are working on branch main/task001

* You decide to move to main

* It is correct that Plastic deletes the files you added in main/task001 locally to move you to main, correct?

Well, this is what you did.

I have come to understand this now, again wrongly assuming that there would be a local cache or these types of things.   

 

Quote

Needless to say I personally dislike "delete changeset" and I think it is a really bad option to have, but you know, users didn't stop till it was added.

I agree. At most an archive or hide changeset option would have been better.. 

 

Quote

Are you using Jet? If so, we can probably recover your actual data because it will not be really deleted from the database... but we would need you to send us your data for that. You should contact support.

Yes, I am using Jet.  I've contacted support but have yet to receive a reply so I don't know if they are around.. I'll prep the entire repo for them and send them a link where to download it.  I was assuming, seeing as the repo size didnt go down when we deleted this stuff, that the files are in there, I just have no way of extracting them.  Is there a tool I can grab to do this?

Share this post


Link to post
Share on other sites

They'll need to do some digging to actually find the actual data.

Let's move this to a support email thread and see what we can do

Share this post


Link to post
Share on other sites

You are very welcome! :)

As we discussed during the Skype call we'll study how to avoid this to happen again.

Share this post


Link to post
Share on other sites

From my side just a comment/remark.

In my opinion PlasticSCM SHALL remove files from workspace when switching to changeset without revisions of such files.

In other case it may happen than switching between changesets result with unupdated workspace - and that is not good.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now