This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

PVCS - Renaming Files

Hello,

Occasionally I use Windows Command Prompt to change the name of a file in PVCS since that way the file will retain its history, however, I've been trying to rename about a dozen documents and after a few file changes PVCS will disconnect from the server we have it on. We then restart the server, and then once again, after a few file changes, run in to the same problem. This only seems to happen when I'm using Windows Command to change file names.

Are these two things, in fact, related? If so, is there anything that can be done to prevent this?

Please advise. Thank you.
  • 0
    Can you show your process from the command line? I do renames from the command line, too, but it involves a number of steps that I ended up scripting.
  • 0  
    I second Gerard's request. Kindly indicate as well which VM release you are running on the client doing the renaming and on the VM File Server.

    If the knowledgebase.serena.com/.../index
  • 0
    Gerard/Richard,

    I'm running VM 8.5.0.0. After navigating to the location of the folder (using command cd), I enter vcs -w"[new document name.docx]" "[old document name.docx-arc].

    I then rename the file in its archive location on the server and then in the PVCS GUI, 'Import' it.
  • 0
    I do the following under 8.5.x.x:

    vcs -w"[new document name.docx]" "[old document name.docx-arc]
    vtransfer -r "[old document name.docx-arc]" "[old document name-TEMP.docx-arc]"
    vtransfer -r "[old document name-TEMP.docx-arc]" "[new document name.docx-arc]"

    I forgot the reason why the vtransfer is done in two steps. I think it's to handle cases where the rename involves just a change in case.
  • 0   in reply to 
    10 points for Gerard! :) Yes, that is the reason you (potentially) do it in two steps.

    Following this, do you use "pcli delete" followed by "pcli importarchives"?

    The VM 8.6 Rename command effectively combines this under the hood, without having to delete the entity, plus it deals with updating the shared archives (if you have any). If you know you don't have shared archives to worry about the vcs/vtransfer/delete/importarchives route is faster at this time, though that's something we're hoping to change.
  • 0
    Richard: I did not script the delete an import. I would do that though the GUI. Do you have the commands handy?
  • 0  
    Certainly! You need to have the PDB path and entity path to run these commands:
    pcli delete -pr"PDB" -id"Credentials" "EntityPathToFile"
    
    pcli importarchives -pr"PDB" -id"Credentials" -pp"EntityPathToProject" "PathToArchive"

    For the delete command you could also use the entity path to the project and the name of the file:
    pcli delete -pr"PDB" -id"Credentials" -pp"EntityPathToProject" "NameOfFile"


    Of course this could all be combined into a single PCLI script that figures out the archive path based on the entity path and runs the vtransfer command(s) as well. I don't have that handy at present but could cook one up for you, if you're interested. I wrote a pre-6.5 archive suffix converter once (renaming archives like makefile.txv to makefile.txt-arc) and it has about 80% of the functionality needed to pull this off. It's surprisingly complex to do well in a generic way, so it works on FS and non-FS alike, and would still have to make assumptions on the PDB archive suffix being the standard arc and .-arc pair, as there's no easy way to compute the archive name for a given workfile name for a non-standard ArchiveSuffix directive in PCLI.

    VM 8.6's Rename command can do it all, of course ;-)

    Cheers,

    - Richard.
  • 0  
    Jennifer, the commands you are running are technically okay and I can see no reason why VM would lock up. However, VM 8.5.0.0 does have a number of issues on archive path handling. At minimum you should run 8.5.0.1, though ideally 8.5.3.0 or 8.6.0.0 (which also makes Rename available in the I-Net Web Client and PCLI).

    Note that in the VM 8.5.x GUI you can rename a file from the Desktop Client GUI, so you don't have to resort to using command line. See KB doc knowledgebase.serena.com/.../index
  • 0 in reply to   
    We use Cygwin so we scan use bash scripts to manage things from the command line. I took some time to add the delete and import commands into the bash script and it seems to work. Obviously a PCLI script would be a lot cleaner.