Jump to content

Single file has gone missing but can't re-add: "file exists"


notken

Recommended Posts

Hi there. We've been using Plastic for nearly a year, and somehow a single file has been inadvertently deleted, or possibly accidentally moved into a sub-folder (there's a copy of it in a sub-folder, where it wouldn't normally be so I think that's what's happened and not been noticed). The problem is we can't seem to get it back where it belongs now.

So in my main branch, this file, Web.config doesn't exist, but in all sub-branches it does. So if I swap to a sub-branch, it comes back, but the moment I go back to the main one, it's gone. If I explore it in the client, it's not there. But if I manually copy the file back in from a backup it shows as Private, and if I try to re-add it, the client complains that the file exists. Update or Update Force of the workspace doesn't bring it back, and I can't merge from a sub-branch where it exists as it doesn't come up in the merge window. It seems to both exist and not exist, but I can't include it in my project any more.

Is there any way to remove it from the Plastic db so I can re-add it? I don't need the previous changes. I just need it back in the project as it won't compile without it.

Thanks.

Link to comment
Share on other sites

Hi notken,

The easiest way to fix it is creating a new revision of the file and the directory containing the Web.config file.

In order to do that, swap to a sub-branch where it exists, checkout the file and the directory that contains the file and checkin them again. When the client complains that the file has no changes, select "force checkin". In this way, a new revision of the file will be created with the same data, and also a new revision of the directory. So now you can swap to the main branch and merge from that sub-branch, and both the file and directory, will appear as candidates to be "Copy-Merged" in the merge window. Merge both items and you will be able to load the file on main branch.

Let me know if it helps.

Link to comment
Share on other sites

Hi there. Thanks for the quick reply. Sorry it's taken me longer. I didn't get the message that the thread had been replied to and only just thought to check again.

I got a Copy-Merge suggestion, and I do Merge-All, but it still doesn't appear in the folder, despite the Merge window claiming it's finished and there are no more merges. Still no sign of the file. If I then view Pending changes it doesn't appear in the list, although the containing folder does.

I've also tried use the Windows Explorer context menu to move the file from the location it's mistakenly in back to where it belongs, but Plastic says it can't overwrite something that's already there. It's not!

Really not sure what I can do about this. Would very happily delete it complete from the main branch and add it back in again as a new file. I don't need to know the history of this file. It just needs to exist to make sure the whole site compiles!

Link to comment
Share on other sites

Hi!

Well, we need some more extra info to check why the merge operation is discarding the file.

First of all, ensure you created two new revisions of both items, the file and the directory containing it on the sub-branch. You can check it by showing the changeset diffs.

Second, switch to main branch and ensure there are no pending changes in your workspace before launching the merge operation.

Next, open a command line shell, cd to the root of your workspace and execute the following command:

cm merge br:/main/SUB-BRANCH --verbose --merge

Send us the command output so we can check why the merge is discarding the file.

Link to comment
Share on other sites

There's a lot in the report (I had to un-checkout and then pipe it to a text file because it disappeared off the top of the cmd console), but it's mostly saying files that don't need to be merged any more. The key lines, I guess, are these:

Merge needed on item d:\Users\Steve\Documents\Source code\C#\Paladin\Paladin v3\WebUI\WebUI\Views from br:/main-0/spo-027#2 to br:/main-0#13 base br:/main-0/spo-027#1. Changed by destination contributor.

Copy merge needed on item d:\Users\Steve\Documents\Source code\C#\Paladin\Paladin v3\WebUI\WebUI\Views\Web.config from br:/main-0/spo-027#3

Merging d:\Users\Steve\Documents\Source code\C#\Paladin\Paladin v3\WebUI\WebUI\Views

Merge done

Copy-merging d:\Users\Steve\Documents\Source code\C#\Paladin\Paladin v3\WebUI\WebUI\Views\Web.config

Element d:\Users\Steve\Documents\Source code\C#\Paladin\Paladin v3\WebUI\WebUI\Views\Web.config discarded to merge, because during the merge process that element has been deleted.

So it seems to be stuck on the file having being deleted. Is it a problem to delete a file and then at some point in the future put it back again?

Link to comment
Share on other sites

Hello notken,

maybe you can try the following.

Switch to the merge source branch, the one is having the "Web.config" file. Then, using PlasticSCM, move the "Web.config" file to your workspace root path. Checkin all the changes and switch back to your main branch.

Try again the merge operation with the '--verbose' parameter and also the '-ls' parameter.

Tell me if it works for you,

Regards,

manu.

Link to comment
Share on other sites

Thanks for the suggestion. I've only just been able to try it and that hasn't worked either. I couldn't move it to the root as there's already a different web.config file there, so I tried moving it into a different folder. When I merged with the --verbose switch I got this:

Merging d:\Users\Steve\Documents\Source code\C#\Paladin\Paladin v3\WebUI\WebUI\Scripts

Merge done

Merging d:\Users\Steve\Documents\Source code\C#\Paladin\Paladin v3\WebUI\WebUI\Views

Merge done

Copied d:\Users\Steve\Documents\Source code\C#\Paladin\Paladin v3\WebUI\WebUI\Scripts\Web.config

The main branch then has this web.config file in Scripts. All good so far. I check that in to make sure.

I now try to move Web.config from Scripts back to Views and get the usual message: "Can't move. Destination ... already exists. Overwriting items is not allowed."

This has become a huge problem. I can't believe there's not some way I can avoid the UI and tell Plastic to stop being so bloody stubborn about it and purge it from the database.

Thanks for your continual help.

Link to comment
Share on other sites

Hello notken,

You are using PlasticSCM 3.0 series, right?

Just to confirm, can you through the the GUI, perform a Diff with previous operation over the "Views" directory? Can you check if the bloody file is in the diff?

I'm afraid that next step is going to be a little bit hacker :)

Regards,

Manu

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...