summaryrefslogtreecommitdiff
path: root/bin/svn_props.py
blob: da1a6d62df9ec5da5cbe5c48d48830358ebcc026 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/usr/bin/python

import sys
import re
import os
import string

print """WARNING:  this script is dumb.  I mean, really, really dumb.  Every file is treated
as a text file, so if you are checking in any binary files, YOU MUST set a non-text
MIME type by hand, otherwise it WILL be corrupted by the checkout process.
A better approach will be to add the unmatched files to the config file in
ACE/docs/svn/config (and update yours!) so others won't have to put up with them 
in the future.

To use this program, copy and paste the output from the svn command into standard
input.
"""

foo = raw_input("That being said, if you want to continue, press enter")

sin, sout = os.popen2 ("svn info")
sin.close ()
os.wait ()

url = ""
root = ""
path = ""

for line in sout.readlines ():
    if line.startswith ("URL: "):
        url = line.replace ("URL: ", "")[:-1]
    if line.startswith ("Repository Root: "):
        root = line.replace ("Repository Root: ", "")[:-1]

path = url.replace (root, "")[1:] + '/'
files = ""

eol_style = " svn ps svn:eol-style native "
keywords = " svn ps svn:keywords 'Author Date Id Revision' "

for line in sys.stdin.readlines ():
    ln = line[0:line.find (':')] + ' '
    ln = ln.replace (path,"")
    os.system (eol_style + ln)
    os.system (keywords + ln)