Friday, April 24, 2015

Change previouly commited svn commit message log

committed a change into SVN (subversion) and found that you used the wrong messages file - meaning that the log message for the revision is wrong?

If so: it's good to know that subversion allows you to change the message - possibly with some help from the administrator. If that's you - so much the better.

Here's one process that could help. This example is for a linux system, but can easily be adapted to others.

When in the working copy folder, try the command (replacing "1234" with the revision number you want to edit the message for).

    export SVN_EDITOR=vim
    svn propedit -r 1234 --revprop svn:log

This will launch "vim" and allow you to edit the message text. When you're done and you save the updated file svn will attempt to apply the change to the server repository.

It is possible that the svn server is not set up to allow this, in which case you may see something like this..

    svn: E165006: Repository has not been enabled to accept revision propchanges;
    ask the administrator to create a pre-revprop-change hook

If you see this message then you (assuming you are the admin) can check the "hooks" directory of the server's repository. For example (your repository will almost certainly be in a different place)..

    cd /opt/svn/myrepos/hooks
    ls -l

Check to see whether there is a file called "pre-revprop-change" listed with execute permissions. If not, and there is a "pre-revprop-change.tmpl" file then review it's contents and if you are happy with the logic it contains, copy it into place. If the file already exists then stop here (dont do the copy) - and investigate why it is preventing your request to update the log.

So, if the file is missing...

    cp pre-revprop-change.tmpl pre-revprop-change
    chmod +x pre-revprop-change

On my system, the template file has the default contents - namely (excluding comments)..

    REPOS="$1"
    REV="$2"
    USER="$3"
    PROPNAME="$4"
    ACTION="$5"

    if [ "$ACTION" = "M" -a "$PROPNAME" = "svn:log" ]; then exit 0; fi

    echo "Changing revision properties other than svn:log is prohibited" >&2
    exit 1

This allows the log to be modified, but blocks all other edits on revision properties. For our situation, this is perfectly fine.

Once the file is in place, return to the working copy and try again. Hopefully, this time your change will be accepted.

Monday, February 23, 2015

How to: Spreadtrum ADB (Android Debug Bridge) Drivers / Setup – ZTE U791 – Windows 7 64Bit and MAC

 recently bought a very cheap ZTE U791 that I wanted to use as a debugging device while developing an Android app.

It took me a whole day to find the correct drivers that would work, Windows 7 64Bit made it even harder.

Like every Android phone, you have to install ADB and its drivers to access the Android Debug Bridge.

To install the ADB intereface simple install the Android SDK if how have not already.

http://developer.android.com/sdk/installing/index.html

You will then have to install the Phone drivers on Windows:

You can check in the Device manager to make sure there are no devices with exclamation marks once you have installed the drivers below!

I tried tons of drivers to get it to work – the one that worked for me was the Debug Drivers below – but you might need to install both:



ADB Drivers: https://www.dropbox.com/s/r50r39o2ia6pmkt/Spreadtrum-Drivers.7z?dl=0

Debug Drivers: https://www.dropbox.com/s/kjt76ecr786zvke/SCI-android-usb-driver-jungo-v4.7z?dl=0



Then the VERY IMPORTANT STEP:

 Then you will have to tell ADB what phone to use. By that I mean adding the PCI ID to a text file to tell ADB that this peripheral is compatible.

The Spreadtrum PCI ID is 0x1782

add this line to “Your user directory/.android/adb_usb.ini”

for example

C:\Users\drk\.android\adb_usb.ini

If the file does not exist create it.

Add this Code:
1    0x1782

 Then the phone should work and be detected by your PC:

To test navigate to your Android SDK Directory and run: adb devices
1    C:\sdk\platform-tools adb devices
2    List of devices attached
3    19761202 device



On a Mac you would also need to add this Vendor ID – it is however easier and you also have the ability to FIND the Vendor ID for the specific phone.

Add the Vendor ID to the following file:
1    ~/.android/adb_usb.ini

You might have to kill and start the ADB server with
1    adb kill-server<br /><br />adb start-server



To find the Vendor ID on a Mac all you need to do is

1. Plug in the Phone

2. Click the Apple Logo

3. Hold the Control Button and Click on System Information

4. Open the USB and then the USB Phone Section

You should see something like this

MAC Spreadtrum Vendor ID

Monday, February 16, 2015

How to set up a proxy server with XAMPP on Windows

1. Set up Apache

    Open your apache config file C:\xampp\apache\conf\httpd.conf. Make sure the following lines are uncommented:

      Include "conf/extra/httpd-proxy.conf"
      LoadModule proxy_module modules/mod_proxy.so
      LoadModule proxy_connect_module modules/mod_proxy_connect.so
      LoadModule proxy_http_module modules/mod_proxy_http.so

2. Open your proxy config file C:\xampp\apache\conf\extra\httpd-proxy.conf. Edit it to match the following:

<IfModule proxy_module>
  <IfModule proxy_http_module>
    ProxyRequests On
    ProxyVia On
    <Proxy *>
      Order deny,allow
      Allow from 127.0.0.1
    </Proxy>
    ProxyBlock some-website-you-want-to-block.com another-website-you-want-to-block.com
  </IfModule>
  </IfModule>
 
3. Restart Apache