Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

fileContents parameter & Entry constructor

Help
cvsclient
2005-01-13
2013-04-25
  • cvsclient
    cvsclient
    2005-01-13

    hi,

    if i wanna import all the files resided in a local directory into the CVS repository, i did the following steps:
    1. construct a WorkingDirectory instance with the appropriate information.
    2. construct a Folder instance with the local directory that contains all the files to be imported.
    3. Add the Folder instance created in Step#2 into the Folders collection of the WorkingDirectory instance created in Step#1.

    am i right? in addition, i am confused while constructing the Folder instance. what does the Entries property of the Folder object mean? need i populate it with the Entry object? if it is the case, how should i do? i checked the source of the Entry constructor and noticed the fileContents parameter. what does this parameter mean? how should i pass in when i construct an Entry instance?

    sorry for those simple questions. i am a complete newbie to CVS.

    thanks here in advance for your help.

    Gary,

     
    • Hi again, those look like the correct steps, but number 2 might have more stpes.  Let me explain the Folders/ Entries question and you can determine if there is something missing there.

      The Folders/ Entries objects are just designed to represent the Cvs management files on your file system.  So in cvs Directories are a management "file" as are the CVS\Entries, CVS\Root, etc. files.   The object map can be represented using a tree/ directory view:

      Folders (collection of directories)
         |
         | ----Folder (directory)
                     |
                     |-----Root (connection info)
                     |-----Repository (remote path info)
                     |-----Entries (files + version info)
                     |            |
                     |            |-----Entry (file being managed)
                     |            |-----Entry (file being managed)
                     |            |-----Entry (file being managed)
                     |            |-----Entry (file being managed)
                     |
                     |-----Root (connection info)
                     |-----Repository (remote path info)
                     |-----Entries (files + version info)
                     |            |
                     |            |-----Entry (file being managed)
                     |            |-----Entry (file being managed)

      So to answer your questions:

      > what does the Entries property of the Folder object mean?

      this represents the CVS\Entries holds a list of the managed files

      > need i populate it with the Entry object? if it is the case, how should i do?

      Yes, look at the Entry.CreateEntry(FileInfo) method.

      > ...fileContents parameter. what does this parameter mean?

      Hmm, maybe a bad name.  It is a single line from the CVS\Entries file, not the contents of the managed file.  If you are loading an existing Entry from CVS\Entries it might be easier to use Entries.Load[filePath] to get the Entry information.

      Cheers,

      Clayton

       
      • cvsclient
        cvsclient
        2005-01-13

        Hi Clayton,

        i really appreciate for your help. your reply cleared almost all of my confusion, except for the construction of an Entry instance.

        based on my understanding, in the case of import command, i can populate the Entries property of a Folder object by invoking the Entry.CreateEntry method by passing the full path of each file to be imported. however, before invoking the CreateEntry method, i have to construct an Entry instance. so comes my problem, what should i pass in for the fileContents parameter?

        for example, i have a local directory called D:\testimport. under this directory, there is a file called test.txt. in this case, how can i populate the Folders property of the Working Directory object? can you show me some code snippet?

        sorry for my "stupid" questions.

        Cheers,

        Gary,