Subversion extension for vcs

Product Compare Forums Multi-Edit Support Subversion extension for vcs

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #781
    AndyColson
    Participant

    I have started to play with subversion which is very much like cvs. At first I tried to just renamed the executables in the cvs config, but CvsChkLib() needs to be totally replaced. So I copied the Cvs.s file to Svn.s and renamed the macros as well. Then I created a new vcs entry called Svn. So far so good. In a simple way I can check in and out and get the history.

    Now for the questions:
    Does xxxChkLib decide if the file is in the repository? (determin if checkin or add new should be used?)

    The CVS config has <~#CvsOpt> but I can find no place that its set… whats it for?

    In the CVS config, the archive path is set to <LOOKUP>. I assume thats the little translate directory popup window thing. I dont really understand what I should put in here or what its used for. The online help says:

    Path: This text box contains the path that Multi-Edit uses to locate the archive file for the file being checked in or out

    What is ‘the archive file’. Is that the cvs repository? In my case the repository is on a different server.

    Thanks

    -Andy

    #3601
    John Peacock
    Participant

    I have started to play with subversion which is very much like cvs. At first I tried to just renamed the executables in the cvs config, but CvsChkLib() needs to be totally replaced. So I copied the Cvs.s file to Svn.s and renamed the macros as well. Then I created a new vcs entry called Svn. So far so good. In a simple way I can check in and out and get the history.[/quote:3hgnljtt]

    I also got this far and have changed SvnChkLib to correctly find the filename in the .svn/entries file. I can also pull out the repository path (URL) from the entries file, but I don’t know how to

    A) Store that (in the global vcsAFile) for later use;
    B) Include the URL on the command line (required for add operation).

    It would help a lot of the VCS support were better documented (i.e. a skeleton for all files/changes required to add new supported backend).,

    John

    #3603
    John Peacock
    Participant

    Is it only me, or was there a lot more timely traffic on the old web forum?

    Why does Search_File() return the line number that the SStr was found on, but there is apparently no way to directly access that line, nor is Found_String set to any useful value? I need to find the URL in the .svn/Entries field and return it as the ARCDIR (seems the appropriate variable). Do I have to actually open the file, read that number of lines, then do another Search on that line to get the regex populated?

    John

    #3609
    ReidSweatman
    Participant

    Let me address these in order. First, <~#CvsOpt> is a metacommand that inserts the global variable #CvsOpt into the command-line where it occurs. This is a global that would most commonly be set in Multi-Edit’s StartUp.cfg file, to add global options to the CVS commands; by default, there are no options set. Change that to suit your needs.

    CVSChkLib() searches a specified path for the archive, returning its findings as a return value that can specify any of several things (see the macro’s comment header), and as two temporary globals, one of which duplicates the integer return, the other of which contains the found archive or path, depending on the value of the Path Mode variable and whether the archive was found or no.

    An “archive” is indeed a repository. If this seems an inconsistent usage, note that not all VCS packages use the same terminology, and no matter what we called it, we’d be inconsistent with some packages. I’ll make a note to clarify this in the documentation. One thing to observe if your repository is on another machine: you must have a mapped path to it, not a UNC path.

    The <LOOKUP> VCS metacommand translates to the archive path matched in the list of Associate Directories. For information on how this works, and how to set it up, refer to Using Associate Directories and VCS Metacommands in the online help.

    The only place vcsAFile should be set is in the macro VCSCmds() in VCS.s. Any global beginning with “vcs” is defined in VCS.sh, and should only be modified by macros in the associated source file. VCS.s functions one level of abstraction higher than the various package-specific files like CVS.s, and the lower-level macros must respect that hierarchy, or there’ll be Self-Reference of the Bad Kind (SRotBK, henceforth to be an officially-ignored but self-important acronymic neologism :) ).

    Agreed, documentation of the VCS system would be nice. It hasn’t happened yet simply because packages were added on a one-by-one basis for a long time, with different custom code written to support each. These were very much one-off projects, requiring a lot of hands-on with the VCS package involved. The system has been somewhat rationalized more recently, but it still involves a lot of new code and filing things down until they fit, so it’s difficult to give a “skeleton” in the sense that you mean it. The VCS support is one of the most complex portions of the program. Roughly half the Tier 2 support issues I handle involve VCS, and they’re invariably bears. One big reason for this is simply that the companies that sell the products aren’t entirely forthcoming with the information necessary to support or maintain integration with their products, and there have been none willing to assist or to supply more than the same time-limited demo anyone could download from their sites. With Open Source projects, at least I can get one to play with (although I can’t replicate the network behavior…never mind why :) ).

    I’m not sure what you’re looking for Search_File() to do that it doesn’t. To access the line, open the file, move to the line, and call Get_Line(), or mark it as a block and copy it to an internal buffer. It’s probably a lower-level function than you’re wanting. Its only real purpose, as you’ll see if you do a quick search for it in all the macro code–three calls, total–is to find a file. Basically, to determine existence and location. If you want higher-level search capability, look at S_And_R() in Search.s.

    Look through some of the WebLair files for techniques and regexes for manipulating URLs.

    And lastly, ARCDIR isn’t a variable, it’s a text string that some of the macros take as a parameter, in which case it looks up the value set in the configuration file.

    I’ve discussed this with Dan, and it’s likely we’ll add support for Subversion, but with the release and ongoing updates underway, we won’t be able to get to it immediately. If Subversion is now a viable package, though, we’d like to add support as quickly as we can manage.

    #3612
    John Peacock
    Participant

    CVSChkLib() searches a specified path for the archive, returning its findings as a return value that can specify any of several things (see the macro’s comment header), and as two temporary globals, one of which duplicates the integer return, the other of which contains the found archive or path, depending on the value of the Path Mode variable and whether the archive was found or no.[/quote:2gjc7l8o]

    So if in SvnChkLib() I set the global vcsAFile, then I should be able to access that somewhere else?

    The <LOOKUP> VCS metacommand translates to the archive path matched in the list of Associate Directories.[/quote:2gjc7l8o]

    Except that in cvs.s:CvsAdminPrj() (and by extension svn.s:SvnAdminPrj) this code is stubbed out completely. Is there another place I could steal code from?

    I’m not sure what you’re looking for Search_File() to do that it doesn’t.[/quote:2gjc7l8o]

    Obviously, I expected it to set Found_Text in addition to returning the line number. I want a way to search a file and return a line from (or matching regex terms) without having to manually open, search, close the file. I’m not changing the file, just pulling some text from it.

    To access the line, open the file, move to the line[/quote:2gjc7l8o]

    I don’t see a single line oriented file macro (in the Help file at least). Care to point me in the correct direction?

    If you want higher-level search capability, look at S_And_R() in Search.s.[/quote:2gjc7l8o]

    Not documented in the help file, I’ll take a look at it…

    And lastly, ARCDIR isn’t a variable, it’s a text string that some of the macros take as a parameter, in which case it looks up the value set in the configuration file.[/quote:2gjc7l8o]

    I needed a metacommand that I can plug into the command line argument as the repository location. Now that I look at VcsXLate (and SvnXlate), I see how I can the effect of a metacommand, once I figure out how to get the text out of the Entries file.

    John

    #3628
    John Peacock
    Participant

    OK, so I have a working svn.s (including a SvnFindURL function, which it turns out I don’t need at the moment). I’ve added a page to the Twiki:

    http://www.multiedit.com/twiki/bin/view … ionSupport

    and hope that others will find it useful.

    John

Viewing 6 posts - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.