[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [platform-cvs-dev] Getting the revision number of a removed file

Brain,

I would suggest to take a look at "Restore from Repository..." wizard [1].
It's purpose is to browse files that have been deleted and restore selected
ones. The best place to start would be
RestoreFromRepositoryFileSelectionPage[2] class in org.eclipse.team.cvs.ui
plug-in.

Let me know if you have any further questions. Good luck :)

[1] Available under Team > Restore from Repository...
[2]
org.eclipse.team.internal.ccvs.ui.wizards.RestoreFromRepositoryFileSelectionPage
--
Tomasz Zarna


                                                                           
             "Nettleton,                                                   
             Brian"                                                        
             <brian.nettleton@                                          To 
             windriver.com>            <platform-cvs-dev@xxxxxxxxxxx>      
             Sent by:                                                   cc 
             platform-cvs-dev-                                             
             bounces@xxxxxxxxx                                     Subject 
             rg                        [platform-cvs-dev] Getting the      
                                       revision number of a removed file   
                                                                           
             2008-07-18 02:26                                              
                                                                           
                                                                           
             Please respond to                                             
               "Eclipse CVS                                                
                Integration                                                
             developers list."                                             
             <platform-cvs-dev                                             
               @eclipse.org>                                               
                                                                           
                                                                           




I'm trying to add a feature to Eclipse with the CVS plugin where I can add
a tag to a file which is being deleted.  I want to tag the deleted
revision.  For clarity, here's an example of how I might do this using
standard cvs commands:


bash-3.00$ rm FileToBeDeleted.c
bash-3.00$ cvs remove FileToBeDeleted.c
cvs remove: scheduling `FileToBeDeleted.c' for removal
cvs remove: use 'cvs commit' to remove this file permanently
bash-3.00$ cvs commit -m "Delete the file" FileToBeDeleted.c
Removing FileToBeDeleted.c;
/cvs/FRA1158/TestNativeApplicationProject/FileToBeDeleted.c,v  <--
FileToBeDeleted.c
new revision: delete; previous revision: 1.96
done
bash-3.00$ cvs status FileToBeDeleted.c
===================================================================
File: no file FileToBeDeleted.c         Status: Up-to-date

   Working revision:    No entry for FileToBeDeleted.c
   Repository revision: 1.97
/cvs/FRA1158/TestNativeApplicationProject/Attic/FileToBeDeleted.c,v

bash-3.00$ cvs rtag -r 1.97 DELETED_FILE FileToBeDeleted.c
cvs rtag: cannot find module `FileToBeDeleted.c' - ignored
bash-3.00$ cvs tag -r 1.97 DELETED_FILE FileToBeDeleted.c
T FileToBeDeleted.c

I've gotten most of this to work from within Eclipse but having a tough
time retrieving the revision number for the file in the Attic.  Here's some
example psuedo code for what I'm currently trying:

    IResource fileToBeDeleted = ...
    ResourceTraversal resourcesToBeDeleted = new ResourceTraversal(new
IResource[]{ fileToBeDeleted } );
    ProgressMonitor monitor = new NullProgressMonitor();
    // The above is just to give some context, not actually the way I
determine these values

    fileToBeDeleted.delete( false, monitor );
    CommitWizard.run(..., resourcesToBeDeleted);
    Subscriber subscriber = CVSProviderPlugin.getPlugin
().getCVSWorkspaceSubscriber();
    subscriber.refresh( resourcesToBeDeleted, monitor );
    SyncInfo syncinfo = subscriber.getSyncInfo( fileToBeDeleted );
    IResourceVariant remoteResource = syncinfo.getRemote();
    String remoteRevision = remoteResource.getContentIdentifier();


This code results in a NPE because the remoteResource is null.  Is there a
good way to get the remote resource once it's been deleted?  I tried just
forcing the parent to be a directory named Attic, but this didn't help.

-Brian Nettleton


    _______________________________________________
platform-cvs-dev mailing list
platform-cvs-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/platform-cvs-dev