elif not os.path.exists(backend.master(source)):
croak("%s is not registered, skipping." % source)
elif os.path.exists(backend.master(target)):
- croak("%s is registered, I won't step on it")
+ croak("%s is registered, I won't step on it" % source)
elif os.path.exists(target):
- croak("%s exists, please delete manually if you want it gone")
- hook(src, target)
+ croak("%s exists, please delete manually if you want it gone" % target)
+ else:
+ hook(source, target)
def move_method(*args):
"Move a file and its history."
do_or_die("rcs -N{0}:{1} {2}".format(tagname, revision, arg))
def move(self, source, target):
"Move a file and its history."
- do_or_die("mv {0} {1} && mv {2} {3]".format(source, target,
+ do_or_die("mv {0} {1} && mv {2} {3}".format(source, target,
self.master(source),
self.master(target)))
def copy(self, source, target):
"Copy a file and its history."
- do_or_die("cp {0} {1} && cp {2} {3]".format(source, target,
+ do_or_die("cp {0} {1} && cp {2} {3}".format(source, target,
self.master(source),
self.master(target)))
def moveto(self, arg, target):
# Needs to not be a subdirectory of here, or git gets confused
SANDBOX=/tmp/src-sandbox
-trap "rm -fr testfile* testrev* $SANDBOX" 0 1 2 15
+trap "rm -fr testfile* testrev* newname* $SANDBOX" 0 1 2 15
check() {
case $? in
cat testfile14 | (cd $SANDBOX/foo >/dev/null; git init --quiet; git fast-import --quiet)
(cd $SANDBOX/foo; git fast-export --all) >testfile15
diff -u testfile14 testfile15
-check "fast-export"
-
-src $TESTOPTS rename testfile1 newname
-check "move"
-
-# untested: ls, moveto, copyto, copy
+check "fast-export"
+rm -fr $SANDBOX/foo
+
+src $TESTOPTS rename testfile1 newname1
+check "move command"
+if [ -e newname1 -a -e $SANDBOX/newname1,v ]
+then
+ echo "srctest: content move succeeded"
+else
+ echo "src: content move failed"
+ exit 1
+fi
+
+src $TESTOPTS copy newname1 newname2
+check "copy command"
+if [ -e newname2 -a -e $SANDBOX/newname2,v ]
+then
+ echo "srctest: content copy succeeded"
+else
+ echo "src: content move failed"
+ exit 1
+fi
+
+
+# untested: ls, moveto, copyto
# end