how to apply output of repo diff

by Sean McNeil » Sat, 14 Feb 2009 19:03:03 GMT


Sponsored Links
 I want to provide a difference of my repo and apply it to a clean copy. 
How is this done? The repo command doesn't appear to support an apply 
command. Is this a planned feature, is there another means to do this 
easily?


--~--~---------~--~----~------------~-------~--~----~

-~----------~----~----~----~------~----~------~--~---



how to apply output of repo diff

by George Jahad » Fri, 06 Mar 2009 16:56:37 GMT


 



Hey Sean:

Here's a guile script that acts as a filter for repo diff output.

Yeh, I know, I should have written it in python.

g


#!/usr/bin/guile \
--debug -e main -s
!#

; Fix the repo diff output so that it can be used with patch like so:
;    repo diff | fixRepo.scm | patch -p1 -R
; comments/questions to george.jahad.andr...@blackbirdsystems.net

(define proj-marker "project ")
(define current-directory "")
(define file-marker "--- a/")


(use-modules (ice-9 rdelim))
(define (main args)
  (let loop ((x (read-line)))
    (if (not (eof-object? x))
        (begin
                                        ; Get the current directory
          (if (>= (string-length x) (string-length proj-marker))
              (if (string=? proj-marker
                            (substring x 0 (string-length proj-marker)))
                  (set! current-directory
                        (substring x (string-length proj-marker) (string-length 
x)))))

                                        ; Update the filename with the current 
directory
          (if (>= (string-length x) (string-length file-marker))
              (if (string=? file-marker
                            (substring x 0 (string-length file-marker)))
                  (set! x (string-append file-marker current-directory
                                         (substring x (string-length 
file-marker) (string-length x))))))
          (display x)
          (newline)
          (loop (read-line))))))

--~--~---------~--~----~------------~-------~--~----~

-~----------~----~----~----~------~----~------~--~---


Sponsored Links


Other Threads

1. Programmatically use VPN on Android ?

I have an application that talks to a remote server which most likely
will be behind a VPN. Is there a way to programmatically enable VPN
and connect to GPRS in Android ?

-- 

2. Google Translate's new TTS feature

The latest version of the Google Translate app appears to use some online 
TTS service (instead of Android's built-in system).

Does anyone know how it does this and whether the service is available to 
3rd party apps?

-- 

3. ANR Camera Button Long Press Event

4. Intent not received after application started

5. IllegalArgument Exception: Service is not registered

6. USB OTG problem in i.MX51 Android r9.4 release

7. [Ask] Biar spica bisa maen game 3D