The Wiert Corner – irregular stream of stuff

Jeroen W. Pluimers on .NET, C#, Delphi, databases, and personal interests

  • My badges

  • Twitter Updates

  • My Flickr Stream

  • Pages

  • All categories

  • Enter your email address to subscribe to this blog and receive notifications of new posts by email.

    Join 1,531 other followers

Archive for the ‘Beyond Compare’ Category

Hunting for Beyond Compare on your system: bc.bat

Posted by jpluimers on 2018/10/23

For my archive bc.bat it finds Beyond Compare, then starts it with the given command line parameters. It prefers version 4 over version 3 and user settings over system settings:

:begin
@echo off
  setlocal
  IF /I %PROCESSOR_ARCHITECTURE% == amd64 goto :x64
  IF /I %PROCESSOR_ARCHITEW6432% == amd64 goto :x64
  goto :x86
:x64
  :: OS is 64bit
  set hkcuBaseKey=HKEY_CURRENT_USER\Software\Scooter Software\Beyond Compare
  set hklmBaseKey=HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Scooter Software\Beyond Compare
  
  goto :findBC
:x86
  :: OS is 32bit
  set hkcuBaseKey=HKEY_CURRENT_USER\Software\Scooter Software\Beyond Compare
  set hklmBaseKey=HKEY_LOCAL_MACHINE\SOFTWARE\Scooter Software\Beyond Compare
  goto :findBC
:findBC
  :: https://gist.github.com/rojepp/634908
  :: http://stackoverflow.com/questions/5369528/windows-batch-reg-query-key-value-to-a-variable-but-do-not-display-error-if-key
  set SupportedBeyondCompareVersions=3, 4
  for %%v in (%SupportedBeyondCompareVersions%) do (
    for /f "usebackq tokens=2* delims= " %%c in (`reg query "%hkcuBaseKey% %%v" /v ExePath 2^>NUL`) do (
      call :do set bcExe="%%d"
    )
  )
  if not [%bcExe%]==[] goto :foundBC
    for /f "usebackq tokens=2* delims= " %%c in (`reg query "%hkcuBaseKey%" /v ExePath 2^>NUL`) do (
      call :do set bcExe="%%d"
    )
  if not [%bcExe%]==[] goto :foundBC
  for %%v in (%SupportedBeyondCompareVersions%) do (
    for /f "usebackq tokens=2* delims= " %%c in (`reg query "%hklmBaseKey% %%v" /v ExePath 2^>NUL`) do (
      call :do set bcExe="%%d"
    )
  )
  if not [%bcExe%]==[] goto :foundBC
    for /f "usebackq tokens=2* delims= " %%c in (`reg query "%hklmBaseKey%" /v ExePath 2^>NUL`) do (
      call :do set bcExe="%%d"
    )
:foundBC
  if [%bcExe%]==[] ( echo no bc.exe found in registry) else (
    echo bcExe=%bcExe%
    if exist %bcExe% start "Beyond Compare" %bcExe% %*
    if not exist %bcExe% echo not found: [%bcExe%]
  )
:exit
  endlocal
:end
  goto :eof
:do
  ::echo %*
  call %*
  goto :eof

–jeroen

Posted in Batch-Files, Beyond Compare, Development, Power User, Scripting, Software Development | Leave a Comment »

Plastic SCM command-line for merge and diff

Posted by jpluimers on 2018/09/03

Just in case I have Plastic SCM without Beyond Compare:

Merge

"C:\Program Files\PlasticSCM5\client\mergetool" -b="%TEMP%\baseFile-guid.pas" -bn="baseSymbolicName" -bh="baseHash" -s="%TEMP%\sourceFile-guid.pas" -sn="srcSymbolicName" -sh="srcHash" -d="...\destinationPath\destinationFile.pas" -dh="destinationHash" -a -r="%TEMP%\resultFile.pas" -t="text" -i="NotIgnore" -e="NONE" -m="forced" -re="NONE" --progress="progressDescription" --extrainfofile="%TEMP%\extraInfoFile.tmp"

Diff

To be done

aa

Merge help (takes about 10 seconds to start):

"C:\Program Files\PlasticSCM5\client\mergetool.exe" --help

---------------------------
Mergetool usage
---------------------------
Usage: mergetool [ | ]

    diffOptions:  []

    mergeOptions:   [] [[] [] ] [] []

        baseFile:            {-b | --base}= 
        baseSymbolicName:    {-bn | --basesymbolicname}=
        automatic:           -a | --automatic
        silent:              --silent
        resultFile:          {-r | --result}=
        mergeType:           {-m | --mergeresolutiontype}={onlyone | onlysrc | onlydst | try | forced}

    generalFiles:  []  []

        sourceFile:          {-s | --source}=
        srcSymbolicName:     {-sn | --srcsymbolicname}=
        destinationFile:     {-d | --destination}= 
        dstSymbolicName:     {-dn | --dstsymbolicname}=

    generalOptions: [] [] [] []

        defaultEncoding:     {-e | --encoding}={none |ascii | unicode | bigendian | utf7 | utf8}
        comparisonMethod:    {-i | --ignore}={none | eol | whitespaces | eol&whitespaces}
        fileType:            {-t | --filestype}={text/csharp | text/XML | text}
        resultEncoding:      {-re | --resultencoding}={none |ascii | unicode | bigendian | utf7 | utf8}
        progress:            {--progress}=progress string indicating the current progress, for example: Merging file 1/8
        extraInfoFile:       {--extrainfofile}=path to a file that contains extra info about the merge

    Remarks:
          
        -a | --automatic:    Tries to resolve the merge automatically.
                             If the merge can't be resolved automatically (requires user interaction), the merge tool is shown.
        --silent:            This option must be used combined with the --automatic option.
                             When a merge can't be resolved automatically, this option causes the tool to return immediately
                             with a non-zero exit code (no merge tool is shown).
                             If the tool was able to resolve the merge automatically, the program returns exit code 0.

    Examples:

        mergetool
        mergetool -s=file1.txt -d=file2.txt
        mergetool -s=file1.txt -b=file0.txt --destination=file2.txt
        mergetool --base=file0.txt -d=file2.txt --source=file1.txt --automatic --result=result.txt
        mergetool -b=file0.txt -s=file1.txt -d=file2.txt -a -r=result.txt -e=utf7 -i=eol -t=text/csharp -m=onlyone
---------------------------
OK   
---------------------------

The merge extraInfoFile.tmp has a syntax like this:

Source (cs:-#)
    relative-sourceFile from cs:-# created by userName on timeStamp
    Comments: Source changeset description

Base (cs:#)
    relative-baseFile from cs:#@/baseBranch by userName on timeStamp
    Comments: BO's + CRUDS 

Destination (cs:#)
    relative-destinationFile from cs@/destinationBranch created by userName on timeStamp
    Comments: Destination changeset description

Where each cs is a change set number.

–jeroen

Posted in Beyond Compare, Development, PlasticSCM, Power User, Source Code Management | Leave a Comment »

Plastic SCM compare versus Beyond Compare; guess which screenshot I like most

Posted by jpluimers on 2018/08/20

Same difference; two tools.

Plastic SCM compare: lots of clutter

Beyond Compare: just the things that are different.

–jeroen

Posted in Beyond Compare, Development, PlasticSCM, Power User, Source Code Management | 3 Comments »

Beyond compare – prefix any registry key comparisons with reg:\\

Posted by jpluimers on 2018/08/03

When you start with a blank registry comparison, then you need to compare keys copied from RegEdit with reg:\

For instance, when fixing [WayBack] Delphi fails to start after Windows did some “Program Compatibility Assistant” magic to it when BDS.exe crashed because the compiler ran out of memory:… – Jeroen Wiert Pluimers – Google+ I compared these:

reg:\\HKEY_CURRENT_USER\Software\Embarcadero\BDS

reg:\\HKEY_CURRENT_USER\Software\Embarcadero\JeroenProfile

Via: [WayBackSpecs

Note: Beyond compare registry settings are in:

  • HKEY_CURRENT_USER\Software\Scooter Software\Beyond Compare 4
  • HKEY_LOCAL_MACHINE\SOFTWARE\Scooter Software\Beyond Compare
  • HKEY_LOCAL_MACHINE\SOFTWARE\Scooter Software\Beyond Compare 4
  • HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Scooter Software\Beyond Compare
  • HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Scooter Software\Beyond Compare 4

jeroen Not sure where the CacheID entry under HKLM is for.

Posted in Beyond Compare, Power User | Leave a Comment »

Diffing binary files in PlasticSCM through Beyond Compare

Posted by jpluimers on 2018/08/02

The diff engine in PlasticSCM is nice in appearance, but it lacks a lot of features for file types that Beyond Compare handles out of the box.

For instance, .RES files cannot be diffed:

---------------------------
Error
---------------------------
Unsupported file types for binary diff. Only images are supported (JPEG, PNG, GIF, BMP)
---------------------------
OK   
---------------------------

Read the rest of this entry »

Posted in Beyond Compare, Development, PlasticSCM, Power User, Source Code Management | 2 Comments »

 
%d bloggers like this: