Changeset 4dedbcc754aa…
Parent 28107d1f2363…
by Stefan Rusek <stefan@rusek.org>
Changes to one file · Browse files at 4dedbcc754aa Showing diff from parent 28107d1f2363 Diff from another changeset...
@@ -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)
|
Loading...