Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Source Control
#1
Does QuickMacros have any options for source control, revision control, or versioning of source code?
#2
No.
#3
Hi -

I'm looking at using git for source control for qml files. I know that qml files are binary and not text - so merge is something I don't want to attempt. But it would be useful to support diff and from this git documentation http://git-scm.com/book/ch7-2.html I was wondering if there was a way to set up an external program to create the diff. For this I'd like to understand the grammar of the files. It looks like there is some type of binary header for each macro - something like
^@^@macroname^@^@<number> <number>
On one level - if I just filter out the ^@ perhaps the diffs would be meaningful enough. Would this be a good start or is there a better approach?

Thanks. I'm very new to QuickMacros (I'm working with Dr. Stuart Pomerantz).

Sean
#4
I can explain .qml format. It is mostly text, but text items are separated with one or several binary bytes.

But maybe more useful would be to have functions to convert .qml to text, eg XML, and back? I'll create the functions if need.

In some new QM version QM will use completely different file format, maybe Sqlite database. Because .qml is too limited.
#5
Convert .qml (QM file) to .xml
Convert .qml (QM file) to .xml
#6
I think this might work but I'm doing something wrong. When I try to compile the code I get
Error in Macro: CLSID is unknown.

Here are the steps that I've followed:
  • In the File menu - selected Open/New File
    Pasted in the code QmlToXml
    (optional) Click on console "Click here to correct the pasted code"
    Then select Compile from the Run menu.

This results in the error above.


When I enter
Code:
Copy      Help
C:\Development\RadFusion>"c:\program files (x86)\quick macros 2\qmcl.exe" M "QmlToXml" A  QmlToXml.qml test.xml
there is no output.

I'm running this on a 64 bit Windows 7 machine.
#7
Replace
IXml x._create
to
IXml x=CreateXml

_create supported in QM 2.3.4.
#8
Thanks.

I decided to go a different direction with this because all I really needed was a clean way to do a diff between versions. I have this working in two different source control applications (git and SourceGear Vault). The basic idea is to use the unix 'strings' command to create text files as input into the diff engines.

With git it's very easy - I had installed git with cygwin and thus had access to 'strings' from the bash command shell. There are pretty good instructions at this URL: http://git-scm.com/book/en/Customizing-G...Attributes. See how they configure the .gitattributes and .git/config file for Word *.doc files - I just did the same with *.qml files. When you enter
git diff
it will show you the differences in the file from the last checkin. It also shows a number of control characters and integer offset differences - but in general it's pretty easy to read.

SourceGear's Vault needed a few extra steps.
  • Install a Windows version of strings:http://technet.microsoft.com/en-us/sysin...97439.aspx
    Create a small batch file qmldiff.bat (source below). Put it in c:\<dirname>. Also create c:\<dirname>\temp. Put the downloaded strings.exe into c:\<dirname>
    In the tools/options menu replace with the default value of "Program:" with
    Code:
    Copy      Help
    c:\<dirname>\qmldiff.bat
    and the Arguments: with
    Code:
    Copy      Help
    "%LEFT_PATH%" "%RIGHT_PATH%"  "%LEFT_LABEL%"  "%RIGHT_LABEL%"

At this point you should be able to show differences in Vault as if it was standard text source code. There will be some of the control characters and offsets displayed in the code but it does show the differences in source very clearly.

Source of qmldiff.bat
Code:
Copy      Help
@echo off
set UTILDIR= c:\<dirname>
REM echo utildir is %UTILDIR%


set TEMPDIR= %UTILDIR%\temp
set TEMPFILE1= %TEMPDIR%\left.txt
set TEMPFILE2= %TEMPDIR%\right.txt
dir %TEMPDIR%
del %TEMPDIR%\*.txt

%UTILDIR%\strings.exe %1 >  %TEMPFILE1%
%UTILDIR%\strings.exe %2 >  %TEMPFILE2%
"c:\Program Files (x86)\SourceGear\Vault Client\sgdm.exe"  /ro1 /ro2 /title1:%3 /title2:%4  %TEMPFILE1% %TEMPFILE2%

I could make the batch file more robust creating directories and doing some error trapping - but this worked for me.


Forum Jump:


Users browsing this thread: 3 Guest(s)