Lots of "Needs Merge"

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

Moderator: SourceGear

Post Reply
jmagaram
Posts: 25
Joined: Wed May 21, 2008 11:17 am

Lots of "Needs Merge"

Post by jmagaram » Wed Jun 03, 2009 12:04 am

I'm a single developer working on a single computer. This may not be relevant, but I branched a project months ago and have been doing a lot of check-outs and check-ins on files in the branched project, and I made just a handful of changes to the files in the original project. Nearly all my work is on the new branched project and that is what I'm discussing here. The Vault client in Visual Studio 2008 shows everything checked in, so all seemed fine. But then I start up the Vault Client and I suddenly see that a very large number of the files in the branched project show status of "Needs Merge". I'm not sure how this happened or how to fix it. In almost all cases the Vault Client shows the "Remote Version" has a higher version number than the "Local Version". I don't know why the local version would be different than the remote (repository?) version since everything is checked in. When I choose "Show Merge" the results are strange. The "Your Local Version" and "Repository Version" are identical and correct and the "Merge Result" (with visible changes) matches both. Since Vault is telling me that the Remote Version is newer than the Local Version, I'm surprised that the Show Merge shows them as identical.

How did I end up in this mess?
Assuming that my local version - the one with the higher version number - is always correct, how do I fix this?
Assuming the "Show Merge" result looks correct, how do I fix this?

I've tried checking out the local files and checking them in again but it doesn't work. I've tried using the "Resolve Merge Status" command, and though this brings the repository version number up to the version number of the local file, it now shows a status of "Renegade" which I can't get rid of.

lbauer
Posts: 9736
Joined: Tue Dec 16, 2003 1:25 pm
Location: SourceGear

Re: Lots of "Needs Merge"

Post by lbauer » Wed Jun 03, 2009 8:00 am

Do a Get Latest with overwrite to update the local files and the client-side cache which is keeping track of the local file status and version.

There are various ways to get into this situation. Needs Merge means the file is old plus edited. This can be because the working directory was set to a directory where files already existed, and when resolving Unknown status, the version was set back to one. It can happen when the cache gets out of sync for some reason.
Linda Bauer
SourceGear
Technical Support Manager

jmagaram
Posts: 25
Joined: Wed May 21, 2008 11:17 am

Re: Lots of "Needs Merge"

Post by jmagaram » Wed Jun 03, 2009 9:05 am

This seems to work when I do the Get Latest command from the standalone Vault Client. But if I do a Get Latest from within Visual Studio, the standalone Vault Client still shows Need Merge, even after I refresh the view. Is this expected? I would assume that Get Latest would work the same regardless of where it is called from.

jmagaram
Posts: 25
Joined: Wed May 21, 2008 11:17 am

Re: Lots of "Needs Merge"

Post by jmagaram » Wed Jun 03, 2009 9:10 am

Another observation. If I do a Get Latest from the standalone Vault Client, it does remove the Needs Merge status. But when I look at the checked-in files in Visual Studio, it shows the Renegade flag icon. So I have to do a Get Latest from within Visual Studio afterward to remove the Renegade status. Is this expected?

lbauer
Posts: 9736
Joined: Tue Dec 16, 2003 1:25 pm
Location: SourceGear

Re: Lots of "Needs Merge"

Post by lbauer » Wed Jun 03, 2009 3:36 pm

No, not expected. It probably didn't refresh for some reason.
Linda Bauer
SourceGear
Technical Support Manager

jmagaram
Posts: 25
Joined: Wed May 21, 2008 11:17 am

Re: Lots of "Needs Merge"

Post by jmagaram » Fri Jun 05, 2009 11:36 am

I removed the client cache and this fixed all my problems.

lbauer
Posts: 9736
Joined: Tue Dec 16, 2003 1:25 pm
Location: SourceGear

Re: Lots of "Needs Merge"

Post by lbauer » Sun Jun 07, 2009 8:03 am

Thanks for the update.
Linda Bauer
SourceGear
Technical Support Manager

jmagaram
Posts: 25
Joined: Wed May 21, 2008 11:17 am

Re: Lots of "Needs Merge"

Post by jmagaram » Tue Aug 04, 2009 1:10 pm

The problem has returned. Again I'm just one guy working on the source code. I have been doing simple CheckOut + CheckIn from within Visual Studio 2008. According to Visual Studio every file for one of my projects was checked in and looked fine - all the normal lock icons. Then I started up the Vault Client and noticed a bunch of files labeled as "Renegade" and "Needs Merge". So I did a "Get Latest" with Overwrite within the Vault Client. But then when I look in Visual Studio a bunch of files are now marked as Renegade. So within Visual Studio I do a Get Latest with Overwrite and it looks fine but then the Vault Client shows a bunch of Renegade. So I can't get them in sync. Either the Vault Client shows a bunch of Renege files or Visual Studio does. This type of problem makes me lose all confidence in Vault. Why is this happening? How do I fix it permanently? Does Vault 5 fix this?

lbauer
Posts: 9736
Joined: Tue Dec 16, 2003 1:25 pm
Location: SourceGear

Re: Lots of "Needs Merge"

Post by lbauer » Wed Aug 05, 2009 2:40 pm

We are not sure why this is happening.

Are you logging in as two different users? It could explain the changes in file status from one client to another. If you diff the the renegade file with the repository version, Is it the same? What about if you diff it to the last version you retrieved from the repository?

A "renegade" file is one which is modified but not checked out. A "needs merge" file is one that has been modified (checked out or not) and is older than the repository version.

So something may be changing the timestamp on your files or modifying your files. It seems to be something specific to your system or workflow.

One thing you could do is work in CVS mode, where you don't need to check out files before modifying them, plus enable CRC's. These changes could eliminate some of the confusing statuses you're seeing. These settings are in the client under Tools ->Options-> Concurrent Development Style and under Tools ->Options-> Local files.

Let me know if this does not resolve the problem.
Linda Bauer
SourceGear
Technical Support Manager

jmagaram
Posts: 25
Joined: Wed May 21, 2008 11:17 am

Re: Lots of "Needs Merge"

Post by jmagaram » Tue Aug 11, 2009 2:09 pm

I switched the source control over the CVS style as you suggested. I wiped out the local cache and rebuilt the cache. I deleted the local directory and attempted to start clean by doing an Open from Vault. I also made sure to use the same login name and password from within the Vault Client and from within Visual Studio 2008. And...it still doesn't work. I made a few changes within Visual Studio and checked them in. So everything looked fine and complete within Visual Studio. But when I looked at the Vault Client (after a refresh), Vault was telling me some files were changed and "Needs Merge". I can't get the Vault Client and Visual Studio to think that all the files are checked in. It seems as if either the Vault Client is unhappy and thinks files need merging and checking it, or that the Visual Studio client is unhappy. How do I "start over" and resolve this?

lbauer
Posts: 9736
Joined: Tue Dec 16, 2003 1:25 pm
Location: SourceGear

Re: Lots of "Needs Merge"

Post by lbauer » Tue Aug 11, 2009 2:52 pm

I'd suggest we schedule a remote assist session where I can take a closer look. Email sourcegear.com, Attn: Linda. Please include a link to this forum post.
Linda Bauer
SourceGear
Technical Support Manager

jmagaram
Posts: 25
Joined: Wed May 21, 2008 11:17 am

Re: Lots of "Needs Merge"

Post by jmagaram » Tue Dec 01, 2009 11:51 am

The problem came back. How do I fix it?

We previously traced it back to somehow having 2 sourcegear database references (or something like that). It was covered in RE: Vault sync issue {216969}. This problem might have something to do with Folder Import/Export. I've been using this as my backup/restore system, and moved the database from one computer to a new one.

lbauer
Posts: 9736
Joined: Tue Dec 16, 2003 1:25 pm
Location: SourceGear

Re: Lots of "Needs Merge"

Post by lbauer » Thu Dec 03, 2009 1:34 pm

Code: Select all

I've been using this as my backup/restore system, and moved the database from one computer to a new one.
Is there a reason you're not backing up and restoring your databases with the Vault backup or SQL Server backup?

This seems to be a workflow issue -- files in the working folder are seen as "old" and "modified" by the Vault Client. This can happen if there are working folders already populated with files and you're connecting to a new repositories on a new SQL Server machine.

I'd suggest starting fresh. Backup working folders in case you have any modified files in them, close your clients, clear the client side cache. Restart IIS. Then set new working folders, do a Get latest of your code. If you want to restore the modified files to the working folders, you can check everything out, and replace the contents with the contents of the backed up folders.
Linda Bauer
SourceGear
Technical Support Manager

jmagaram
Posts: 25
Joined: Wed May 21, 2008 11:17 am

Re: Lots of "Needs Merge"

Post by jmagaram » Wed Dec 09, 2009 11:20 am

if i remember correctly, there wasn't an easy way for me to fix this problem last time without technical support. there were 2 source database IDs in my project somehow so clearing the cache, etc. didn't do the job. i am happy to start using the sql backup/restore but this feature is broken on my computer for some reason - see http://support.sourcegear.com/viewtopic.php?f=5&t=12741

lbauer
Posts: 9736
Joined: Tue Dec 16, 2003 1:25 pm
Location: SourceGear

Re: Lots of "Needs Merge"

Post by lbauer » Wed Dec 09, 2009 11:41 am

Send an email to support at sourcegear.com, Attn: Linda. Please include a link to this forum post and your phone number. I'll give you a call.
Linda Bauer
SourceGear
Technical Support Manager

Post Reply