Public » Kiln Backup
Clone URL:  
Pushed to one repository · View In Graph Contained in tip

Don't delete old repos

Changeset 4dedbcc754aa

Parent 28107d1f2363

by Profile picture of User 4Stefan Rusek <stefan@rusek.org>

Changes to one file · Browse files at 4dedbcc754aa Showing diff from parent 28107d1f2363 Diff from another changeset...

Change 1 of 3 Show Entire File kilnbackup.py Stacked
 
21
22
23
24
 
25
26
27
 
34
35
36
37
 
38
39
40
 
99
100
101
102
 
 
103
104
105
 
21
22
23
 
24
25
26
27
 
34
35
36
 
37
38
39
40
 
99
100
101
 
102
103
104
105
106
@@ -21,7 +21,7 @@
 # THE SOFTWARE.     -import ConfigParser, sys, urllib, urllib2, cookielib, os, subprocess, shutil +import ConfigParser, sys, urllib, urllib2, cookielib, os, subprocess, shutil, time    config = ConfigParser.ConfigParser()  config.read("kilnbackup.cfg") @@ -34,7 +34,7 @@
 settings = dict(config.items('kiln'))    def prompt(msg): - print(prompt) + print(msg)   value = sys.stdin.readline().strip()   if not value:   sys.exit() @@ -99,7 +99,8 @@
    if not hgrc.has_section('paths') or hgrc.get('paths', 'default') != url:   print "Deleting old repo", name - shutil.rmtree(name) + if not os.path.exists("archive"): os.mkdir("archive") + shutil.move(name, "archive/%f-%s" % (time.time(), name))     if os.path.exists(name):   os.chdir(name)