Yikes - lost my changes

If you are having a problem using Vault, post a message here.

Moderator: SourceGear

Post Reply
alovhaug
Posts: 30
Joined: Wed Mar 10, 2004 2:15 pm

Yikes - lost my changes

Post by alovhaug » Wed Mar 10, 2004 2:36 pm

Here's my scenario - not too complex:

I'm using Vault 2.0, single user. I have a solution with multiple projects including two ASP.NET projects - most of the projects are stored in Vault. I'm using the VS.NET IDE to access Vault.

I had checked out most of the files in one particular project, and made numerous changes over the course of several days. On Monday, I checked the complete project in (again, using the IDE). This afternoon, I just started up VS.NET and reloaded the solution, and decided to check out the project again. I checked the whole project out, then decided to undo-checkout for one subfolder in the project, which contains only graphics and non-code files, etc. (I don't really need to update those). Then, I tried to build the project and got a build error. Hmmm - odd, since I am pretty sure it would build before I checked it all in. I haven't completed my analysis, but it is clear that at least one entire form is missing all of the changes made since the project was initially added into Vault.

I have made a backup of the entire solution folder, and I am investigating further. So far, I have discovered that my changes for this particular form do not show up in Vault at all (by using the Vault IDE, I can see there is currently only 1 version of the aspx and .vb file). Also, I have discovered that the _sgbak folder contains a more recent version of my web form, although I'm not sure it is the current one.

When using the VS.NET IDE, am I supposed to do anything other than check in my files when I am done using them? I didn't see any errors when checked them in, so I didn't really anticipate a problem. I was updating a lot more than that one particular form - now I'm not sure how to proceed to minimize any possible data loss.

Any suggestions would be greatly appreciated.

A. Lovhaug

dan
Posts: 2448
Joined: Wed Dec 17, 2003 5:03 pm
Location: SourceGear
Contact:

Post by dan » Wed Mar 10, 2004 3:09 pm

What are the status of the files in the Vault GUI client?

alovhaug
Posts: 30
Joined: Wed Mar 10, 2004 2:15 pm

Status in Vault GUI Client

Post by alovhaug » Wed Mar 10, 2004 3:18 pm

For almost all of the files, the "status" column shows nothing. The .vbprof file and one .vb file show "Edited", but I'm guessing that is because I *briefly* started making changes to fix the build problem, before I realized that my changes were gone.

A few other tidbits - the Vault GUI client shows many items in the Pending Change Set, including those files. So, part of me is thinking that I should just commit those changes. (Hey, couldn't get any worse, right?) Assuming you agree, I will give that a try. But I guess I wondering - is that how it is supposed to be? Meaning: after I check in my files using the VS.NET IDE, I should also go into the Vault GUI and commit the changes? If so, I apologize for my ignorance.

Thanks a lot for the assistance.

A. Lovhaug

dan
Posts: 2448
Joined: Wed Dec 17, 2003 5:03 pm
Location: SourceGear
Contact:

Post by dan » Wed Mar 10, 2004 3:35 pm

Ah. Yes, you should commit those changes - that is why they were not showing up.

Do the same items show up in the pending change set of the IDE? You may have done a checkin from one of your projects but not the others from within the IDE?

alovhaug
Posts: 30
Joined: Wed Mar 10, 2004 2:15 pm

Ahhhhh.

Post by alovhaug » Wed Mar 10, 2004 3:37 pm

Possible. I have another emergency I need to address right now, but when I return I will commit the changes, and see what happens. I promise to post an update here.

Thanks for your assistance!

A. Lovhaug

alovhaug
Posts: 30
Joined: Wed Mar 10, 2004 2:15 pm

Source code still lost

Post by alovhaug » Wed Mar 10, 2004 5:28 pm

Here's the latest...

Yes, there were items displaying the pending check-ins in the IDE. However, I'm not sure what that tells me, since today I had checked out the files of my project again. Are "pending checkin" files anything that is checked out, or things that are checked out and modified?

When I used commit, it removed those items from the pending change set. However, the versions haven't changed for the particular file I was examining (yes, I tried refresh in the Vault client IDE), and it still is the version from a few weeks ago. In other words, my changes still appear to be gone.

Here's the scenario I can think of that explains what happened. Does this make sense to you:

1) All files for solution stored in Vault.
2) All files for one project are checked out. Many files are modified over the course of several days.
3) All files are checked back into Vault using the VS.NET IDE. The check in failed (this seems like what must have happened, since none of the version numbers in Vault have changed.)
4) When I checked out files today for project, changes on local machine were overwritten with the files from the Vault server.

I'm pretty sure that I attempted to check in the files on Monday. I remember doing it. Also, when I loaded the project today, the files must have had the write attribute disabled, since they showed the little lock icon.

At this point, I mainly want to figure out what I've done wrong so that I can prevent it from happening again. I know one option is to work outside of the VS.NET IDE. This isn't my preference, but losing my changes is also not a good option.

A. Lovhaug

dan
Posts: 2448
Joined: Wed Dec 17, 2003 5:03 pm
Location: SourceGear
Contact:

Post by dan » Thu Mar 11, 2004 10:10 am

Vault is setup by default to undo the checkout on files that have not changed (during the checkin operation). Is it possible the files that don't have new version numbers were not changed?

Since we can't really tell what happened previously, my advice would be to not checkout the entire project. When you attempt to edit a file, VS.Net will ask you if you want to check it out - say yes, and then make your edits. That way, you'll know that all the files that were checked out were also really edited.

On your next checkin from VS.Net, double check it against the GUI client. Before the checkin, look at which files are checked out from the GUI client. Do the checkin from VS.Net, then refresh the GUI client, and verify that the files are no longer checked out and have their version numbers incremented.

The only thing I can think of that might explain what happened would be if the files you had edited had a status of Unknown in the GUI client before you started editing them. Vault can't checkin files that have an Unknown status. Doing a Get and overwriting the file would have solved that problem.

alovhaug
Posts: 30
Joined: Wed Mar 10, 2004 2:15 pm

Post by alovhaug » Thu Mar 11, 2004 10:27 am

No, I'm pretty confident that several of the files had changed. One form had previously had only two labels, two textboxes and two buttons. I had added several more controls and completed all the associated code to retrieve, save, etc. That's when I knew I had a serious problem, because all that new code was GONE!

Right now, I'm in the process of going through each form and its associated code behind file, and comparing the code to the code that was stored in the _sgbak folder. If there is stuff missing, I am manually re-adding it to my file. Before I try another source code operation, I will be backing up my folder again so that perhaps I will at least be able to recover a little more gracefully.

In fact, I think I will be removing this solution completely from source code control, and starting over. I can see that one of the other projects in this solution seems to currently show files with status "unknown" in the IDE. Funny, the code from that one seems to be fine right now.

I'm sorry I can't provide more useful troubleshooting information. Clearly something went horrible wrong here, and I'm just not sure if it was user error or a software problem. But if I find out something that may help you in the future, I'll certainly let you know.

Thanks for the assistance.

A. Lovhaug

dan
Posts: 2448
Joined: Wed Dec 17, 2003 5:03 pm
Location: SourceGear
Contact:

Post by dan » Thu Mar 11, 2004 10:41 am

One last piece of advice: Do a file status search for Unknown with the Vault GUI client. Any files that are unknown need to be overwritten via a Get from Vault. If those files contain changes you need, be sure to back up the files before the Get, and then overwrite the files that were retrieved..

alovhaug
Posts: 30
Joined: Wed Mar 10, 2004 2:15 pm

Post by alovhaug » Thu Mar 11, 2004 10:58 am

Thanks for the advice - I will keep an eye on that "unknown" status!

By the way, I just thought of something that might be useful future information. Do you know - does Vault work using terminal services? I just realized that when I made the last set of changes and checked my files in, I was accessing my development computer via remote desktop. I didn't think it would matter, since the operations were all occuring on the same computer (just being driven by another computer). But perhaps that is the X factor for why things went so wrong for my project.

Just a thought.

A. Lovhaug

dan
Posts: 2448
Joined: Wed Dec 17, 2003 5:03 pm
Location: SourceGear
Contact:

Post by dan » Thu Mar 11, 2004 11:07 am

That shouldn't make a difference, but you could try to reproduce it that way to see if there is a problem there.

alovhaug
Posts: 30
Joined: Wed Mar 10, 2004 2:15 pm

Post by alovhaug » Thu Mar 11, 2004 11:11 am

Yes, that is exactly my plan after I finish recovering my work.

I'll let you know if I learn anything of value.

Thanks!

A. Lovhaug

Post Reply