Files getting stuck in 'needs merge' status.

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

Moderator: SourceGear

Post Reply
chrisb
Posts: 4
Joined: Tue Dec 02, 2014 9:24 am

Files getting stuck in 'needs merge' status.

Post by chrisb » Tue Dec 02, 2014 9:43 am

As part of a build step in Jenkins I am doing a 'get' from the command line on my project files but am finding files get stuck in 'needs merge' status. When doing get latest from the GUI I rarely if ever encounter this issue. This seems to be something unique to running from the command line. I use the command '-merge overwrite' and assumed that the files would just be overwritten on my local but this is not the case.

How can ensure I get the latest version of all project files without some of them getting stuck in needs merge status? The Vault server version here is 6.1, is this an issue that has been addressed in later versions? Thanks.

Beth
Posts: 8550
Joined: Wed Jun 21, 2006 8:24 pm
Location: SourceGear
Contact:

Re: Files getting stuck in 'needs merge' status.

Post by Beth » Tue Dec 02, 2014 3:28 pm

I can't seem to reproduce the issue you are seeing.

Can you provide more exact steps? Is the file on disk edited before overwriting?

Are users using the same working folder as the build server?
Beth Kieler
SourceGear Technical Support

chrisb
Posts: 4
Joined: Tue Dec 02, 2014 9:24 am

Re: Files getting stuck in 'needs merge' status.

Post by chrisb » Wed Dec 03, 2014 7:50 am

Hi Beth,

It's possible the file is edited on disk before overwriting. There is some test automation software on the machine that opens the files, executes them and then closes them after. There are no other users using the working folder.
I have noticed that all my files also end up in 'renegade' status after doing a get via the command line. I do a diff in the Vault client against the latest version of files in the Vault repo and it tells me there are no differences.

These are the exact steps I am taking:

1. First step in Jenkins build:

::Set working directory on local

CD /D C:\Program Files (x86)\SourceGear\Vault Client && vault SETWORKINGFOLDER -host xxx.xxx.xxx.xxx -user "xxx" -password "xxxx" -repository "xxxx" "xxxx" "xxxx"

2. Second step in Jenkins build:

::Get latest version of test scripts

CD /D C:\Program Files (x86)\SourceGear\Vault Client && vault GET -host xxx.xxx.xxx.xxx -user "xxxx" -password "xxxx" -repository "xxxx" "xxxx" -merge overwrite -setfiletime current -verbose

3. Third and final step in Jenkins build:

::Call Test Execute from command line

"C:\Program Files (x86)\SmartBear\TestExecute 10\Bin\TestExecute.exe" "C:xxxx.pjs" /DoNotShowLog /SilentMode /r /e /p:"Tests"


This might be a stupid question but doesn't the overwrite option just tell Vault to overwrite any files on the local that need updating? Why would it even be attempting a merge? Perhaps you can clarify what exactly the command -merge overwrite does?

chrisb
Posts: 4
Joined: Tue Dec 02, 2014 9:24 am

Re: Files getting stuck in 'needs merge' status.

Post by chrisb » Wed Dec 10, 2014 7:48 am

@Beth,

I think I determined the cause of the issue. Can you confirm if this sounds correct?

1. Files are opened by program that executes our test scripts.
2. Files are saved by the program running test scripts and the file timestamnp changes.
3. Vault puts the files into 'Renegade' status because the timestamp has changed.
4. We do a get from the command line but the files that have changed go into 'needs merge' status because they currently have the renegade status even though none of the file content has changed.

If this is correct can you tell me how to configure Vault or a command to use when do a get from the command line so that files whose timestamp has changed are not put into 'renegade' status? Thanks.

chrisb
Posts: 4
Joined: Tue Dec 02, 2014 9:24 am

Re: Files getting stuck in 'needs merge' status.

Post by chrisb » Thu Dec 11, 2014 12:10 pm

Resolved this issue with help from Beth at Sourcegear support so I am posting the solution here:

1. Open Vault client using the same user as Jenkins.
2. Go to Tools/Options/Local Files in the Vault GUI menu.
3. Select option to 'Detect modified files using CRC's instead of modification times'.

Post Reply