Ignoring version control keywords

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Adrian--1
    Journeyman
    • Feb 2009
    • 13

    Ignoring version control keywords

    How do I ignore version control keywords in my C files? Within C comments I have lines such as
    $revision: some text to ignore$
    $id: more text to ignore$

    I tried importing my BC2 "Rules.xml" file into BC3 but (contrary to what it say in the help file) BC3 merely says "BC2 Rules not importable". Importing the BC2 zip file has a similar response for the rules.

    The help files suggest that "grammars" might be used. But how? What sort of token is the "revision" or "id" above, the grammar allows strings, keywords, comments and so on. Or do I choose a new token type? Some examples would be useful in the help files or in the default set of file and grammar types.

    The help files also suggest that "replacements" might be used. Where is the "replacement tab"? How do I get to it via the menus? The help files did not help me find it! Found a video on the BC support site and it shows the "replacement tab" hiding behind a icon of a head and shoulders.

    Entered a replacement regular expression. In the "text compare session setting" window, what do the column titles "left" and "right" signify? Should they be relabelled as "Text to find" and "replace with" respectively?

    Have work to do, so back to using BC2 for a while.
  • Ernie
    Fanatic
    • Mar 2004
    • 137

    #2
    Use the following Menu items Tools -> File Formats, select your file type (C, C++, C# Source), in the right pane, select the Grammar tab. Click on the New button. Give the element a name, such as SourceControl, category=Basic, Text Matching=\$.+?:.*\$, check Regular Expression. Click OK.

    When comparing your source file, you can click on the little umpire looking toolbar button to modify the comparison rules. You can check or uncheck the the element (I called SourceControl) to denote if it is important or not.

    Caveat: I seems that these source control markers are always within comment blocks. By default, comments are ignored, along with your source control markers. You will have to play with marking comments and/or SourceControl as important/unimportant to get your desired comparison.

    Comment

    • MortenMacFly
      Enthusiast
      • Jun 2007
      • 23

      #3
      See also here:
      http://www.scootersoftware.com/vbull...ead.php?t=3913

      ...it'll probably be implemented any time sooner or later...

      Comment

      • Aaron
        Team Scooter
        • Oct 2007
        • 16002

        #4
        Hello,

        Ernie has some great pointers to start with. Also, BC2 and BC3 can be installed simultaneously, so you can learn how BC3 works while still working with BC2. You can't import Rules into BC3 because the concept is now split up between File Formats and Session Settings. Whereas in BC2 you had do define multiple File definitions if you wanted comments to be important or unimportant, in BC3 that is now controlled by Session Settings on a session specific basis.
        Aaron P Scooter Software

        Comment

        • MortenMacFly
          Enthusiast
          • Jun 2007
          • 23

          #5
          Originally posted by Ernie
          Use the following Menu items Tools -> File Formats, select your file Caveat: I seems that these source control markers are always within comment blocks. By default, comments are ignored, along with your source control markers. You will have to play with marking comments and/or SourceControl as important/unimportant to get your desired comparison.
          That's exactly my point in the other thread. So I think you cannot solve it "nicely" with the concepts proposed here and in the other thread.

          Comment

          • Aaron
            Team Scooter
            • Oct 2007
            • 16002

            #6
            It sounds like you had the Comments not defined in BC2, but defined just the SC variables. So, to mirror that, delete the Comment definitions in your specific File Format, and then create the same Unimportant Element definition you used in BC2, call it "SC Variable". Then go to the Home Screen-> Edit Session defaults folder -> Text Compare's Importance tab, and uncheck "SC Variable"

            Comments won't be syntax highlighted (which you don't have in BC2), but SC Variables could be. Comments will be treated as Important Everything Else text (which I assume you want, otherwise you could mark the whole Comment as Unimportant which is the default behavior).

            This should treat comments and SC Variables as you expect. Let us know if you have any questions.
            Aaron P Scooter Software

            Comment

            Working...