Move file in one AccuRev workspace that has been edited in another workspace

StackOverflow https://stackoverflow.com/questions/20276310

  •  06-08-2022
  •  | 
  •  

Domanda

We have a need to refactor a code base. The thing is that this will be done by one person and it would be desirable to avoid having the rest of the development team sitting idle while this job takes place. We therefore tried the following scenario to see if it is possible to work in parallel.

  1. Created file test.txt in directory first in developer A's workspace.
  2. Promoted this file.
  3. Updated developer B's workspace, thereby getting file test.txt
  4. In A's workspace moved file test.txt to directory second.
  5. Promoted this move.
  6. In B's workspace edited file test.txt while it still resides in directory first (no update is made thereby emulating that work is done while refactoring is taking place).
  7. Tried to promote and got a message saying that file test.txt had been modified (correct, file has been moved).
  8. Tried to merge but got an error message saying that AccuRev can't merge since the file is missing in directory second (where it has been moved).
  9. Tried to update B's workspace but that is not allowed since there is a modified file that needs to be merged first.

We are now stuck in a catch 22 situation. We did try to place a fake file in directory second but that is not being recognized since this file does not belong to the workspace.

Has anyone out there tried something like this and gotten it to work? It is of course possible to copy files but if there is a better way we would be grateful to hear about this. Or if this is a known bug or limitation in the tool. We will contact also contact AccuRev support but I thought that I might be able to get some useful tips from the community.

Currently we are using AccuRev client 5.5.0.

Thanks for any suggestions on how to make the tool support this operation.

È stato utile?

Soluzione 2

After contact with AccuRev support the answer is that the only option available is to copy the file to some temp directory, revert the changes, update the workspace and copy the file into the new location in the workspace.

AccuRev will at least tell you which files you have to copy since they will be marked as modified.

Altri suggerimenti

Referring to your steps 6 & 7: In AccuRev 5.5 after a file is edited and has a (modified) status you first have to keep before you can promote.

At step 8 you could try doing the merge from the Browse Versions view of the file. That way you can select any node to merge with, including the one that has been moved.

Step 9. An AccuRev update will not run successfully if one of the files to be updated is (modified). This is by design. You can keep the file so it has (kept)(member) status then run the update.

David Howland

I could experimentally verify David's remark to step 9 using AccuRev 5.5.

Let's assume that in the workspace of user A the file was moved and the move was promoted, while in the workspace of user B the file was modified and user B is about to promote his/her change.

Before the file is kept, it will not be possible for user B neither to merge nor to update. But after keeping the modified file the update is possible. The file is first marked as overlap, then the merge succeeds in the new location. Basically, this avoids creating a copy of the file, reverting it and restoring it in the new location after an update, which can be quite cumbersome, as AccuRev does not reveal easily where the move goes.

If user B promotes the modification before user A promotes the move, all goes smoothly, i.e. on update the moved file appears as overlap, but easily merges into the moved file in the new location.

Similar results are obtained when the two users have workspaces connected to different streams and the overlap occurs on a common parent stream. Only if the file is unkept, an error can occur (i.e. only if the move is promoted before the change). Then a simple keep allows to proceed as usual (update, merge, then promote).

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top