dracoblue.net

SVN Unterschiede ohne echtes Update

Manchmal möchte man einfach wissen, wo genau was bei einem svn update

geändert werden wird und wie die Dateien danach aussehen werden. Dafür kann man diesen Befehl benutzen.

svn diff -r BASE:HEAD .

Das zeigt den Unterscheid zwischen den Dateien im Verzeichnis (BASE) und der allerletzten Revision im SVN Repository (das bedeutet das HEAD).

Zu dem Trick, habe ich noch zwei weitere.

Wenn man rausfinden mag, welche Dateien geupdated werden hilft dieser Befehl:

svn st -u

Das zeigt leider nicht die Dateien an, die conflicted werden, daher gibt es

diesen workaround:

svn merge --dry-run -r BASE:HEAD .

In subversion by DracoBlue @ 06 Jul 2009 | 115 Words

Generate diff svn update (some kind of dry run)

If you just want to figure out, what files

will be updated and exactly what will be changed you might use this command.

svn diff -r BASE:HEAD .

This will display the differences between current files in the directory (BASE) and the latest revision at the repository (indicated by HEAD).

Just for the record, here are some other useful hints.

If you just want to have all updated files:

svn st -u

This however does not display all conflicted files, so you might use

this workaround:

svn merge --dry-run -r BASE:HEAD .

In subversion by DracoBlue @ 06 Jul 2009 | 110 Words

Refreshing workspace to recover changes ... crash

Since I am using

lunareclipse-plugin + eclipse 3.2 for lua development, I sometimes face the problem (when my pc got switched off too early when trying to hibernate) that eclipse does nothing but crashing when I try to start it.

Log states something like that:

!ENTRY org.eclipse.core.resources 2 10035 2009-06-30 22:19:06.772
!MESSAGE The workspace exited with unsaved changes in the previous
session; refreshing workspace to recover changes.

... and crashs.

I managed to make it working again, by heading to the workspace directory.

workspace.metadata.plugins\org.eclipse.core.resources and removing the file

.snap.

In eclipse, lua by DracoBlue @ 30 Jun 2009 | 97 Words

DJson 1.6 released

Today I want to announce a new release of DJson. The 1.6 is now using a different method to create the cache-file, which allows running multiple djson-scripts (like filterscripts) at the same time.

Also it features a method to define own DJSONMAXSTRING (before include of djson), if you need really big content.

The internal djson cache allows a maximum of ~ 70 characters (255-filenamelength-keylength-170) for a value, if DJSON_MAX_STRING is set to just 255.

Head over to the official

DJson page or directly to the djson 1.6 download.

In djson, open source, pawn by DracoBlue @ 21 Jun 2009 | 94 Words

urlencode in Pawn

When creating new REST-ful API for GTAT (based upon my pwncurl and a lua backend) I had to implement the method urlencode in pawn.

So I took a look at the specification in RFC 1738 to get information about what characters need to be encoded.

RFC 1738: Only alphanumerics, the special characters "$-_.+!*'(),", and reserved characters used for their reserved purposes may be used unencoded within a URL.

Since I really want to be sure that all is encoded properly and %xx encoding is

<!--more-->allowed, too - even if not neceassary - my urlencode function encodes every character except A-Z,a-z,0-9,'-','_' and '.'.

/**
 *  Url encodes a specific string
 *  @param string string
 */
stock urlencode(string[]) {
    new ret[MAX_STRING];
    ret[0] = 0;
    new i = 0;
    new p = 0;
    new s = 0;
    while (string[i] != 0) {
        if  (
                (string[i] >= 'A' && string[i] &lt;='Z')
                || (string[i] >= 'a' && string[i] &lt;='z')
                || (string[i] >= '0' && string[i] &lt;='9')
                || (string[i] == '-')
                || (string[i] == '_')
                || (string[i] == '.')
            ) {
                ret[p] = string[i];
            } else {
                //
                ret[p] = '%';
                p++;
                s = (string[i] % 16); //
                ret[p+1] = (s>9) ? (55+s) : (48+s); // 64 - 9 = 55
                s = floatround((string[i] - s)/16);
                ret[p] = (s>9) ? (55+s) : (48+s); // 64 - 9 = 55
                p++;
            }
        p++;
        i++;
    }
    return ret;
}

This function will also be part of next release of dutils.

In dutils, pawn, pwncurl by DracoBlue @ 20 Jun 2009 | 252 Words

Page 24 - Page 25 - Page 26