]> arthur.barton.de Git - bup.git/commitdiff
Revert (most of) "--remote parameter requires a colon"
authorAvery Pennarun <apenwarr@gmail.com>
Tue, 9 Nov 2010 05:14:04 +0000 (21:14 -0800)
committerAvery Pennarun <apenwarr@gmail.com>
Tue, 9 Nov 2010 05:17:44 +0000 (21:17 -0800)
This reverts (most of) commit c135a5834a9bf9cd9c3382d6489f93e3fdabeafd.

Requiring a colon seems to be too fascist; it makes people think that you
can't use local repositories anymore, which wasn't true: you could just
refer to them as ":/path/to/repo".  But that's just too weird and
non-obvious.  It already resulted in a query on the mailing list, the
avoidance of which is why we added this patch in the first place.  So let's
take it back out.

I kept some minor clarifications and unit test improvements, however.

Signed-off-by: Avery Pennarun <apenwarr@gmail.com>
cmd/init-cmd.py
cmd/join-cmd.py
cmd/save-cmd.py
cmd/split-cmd.py
t/test.sh

index e00574a9fbab9b9213ea90745615ff2ee38b3e39..04f32484d6bd78a6ad2c37022e5ac8af6cedd6a8 100755 (executable)
@@ -15,14 +15,9 @@ if extra:
 
 
 if opt.remote:
-    if opt.remote and opt.remote.find(":") == -1:
-        o.fatal("--remote argument must contain a colon")
     git.init_repo()  # local repo
     git.check_repo_or_die()
-    try:
-        cli = client.Client(opt.remote, create=True)
-    except client.ClientError:
-        o.fatal("server exited unexpectedly; see errors above")
+    cli = client.Client(opt.remote, create=True)
     cli.close()
 else:
     git.init_repo()
index d2cc888cd3020a4404f62aaf37950d848d64077e..81febac4b23c39b3cd3d973e93064eb9f477bd45 100755 (executable)
@@ -20,12 +20,7 @@ if not extra:
 ret = 0
 
 if opt.remote:
-    if opt.remote and opt.remote.find(":") == -1:
-        o.fatal("--remote argument must contain a colon")
-    try:
-        cli = client.Client(opt.remote)
-    except client.ClientError:
-        o.fatal("server exited unexpectedly; see errors above")
+    cli = client.Client(opt.remote)
     cat = cli.cat
 else:
     cp = git.CatPipe()
index c10c216c2274fbd9912597a91359ac579fc0fb59..df51a6c74934c8aca99631e70122752e9986c815 100755 (executable)
@@ -42,12 +42,7 @@ if is_reverse and opt.remote:
 
 refname = opt.name and 'refs/heads/%s' % opt.name or None
 if opt.remote or is_reverse:
-    if opt.remote and opt.remote.find(":") == -1:
-        o.fatal("--remote argument must contain a colon")
-    try:
-        cli = client.Client(opt.remote)
-    except client.ClientError:
-        o.fatal("server exited unexpectedly; see errors above")
+    cli = client.Client(opt.remote)
     oldref = refname and cli.read_ref(refname) or None
     w = cli.new_packwriter()
 else:
index 4155b24014f6a079e06acc90d356a562bf4cd1af..035e8de4b97cf95d6532e5909a9149de8cadc1c2 100755 (executable)
@@ -82,12 +82,7 @@ refname = opt.name and 'refs/heads/%s' % opt.name or None
 if opt.noop or opt.copy:
     cli = pack_writer = oldref = None
 elif opt.remote or is_reverse:
-    if opt.remote and opt.remote.find(":") == -1:
-        o.fatal("--remote argument must contain a colon")
-    try:
-        cli = client.Client(opt.remote)
-    except client.ClientError:
-        o.fatal("server exited unexpectedly; see errors above")
+    cli = client.Client(opt.remote)
     oldref = refname and cli.read_ref(refname) or None
     pack_writer = cli.new_packwriter()
 else:
index 02590aaf7be0f385101cb307205da9b19e21c7bd..4011cd947a504f06d7a5cdfa81c4afa273fc094b 100755 (executable)
--- a/t/test.sh
+++ b/t/test.sh
@@ -116,7 +116,6 @@ WVPASSEQ "$tree1" "$tree2"
 WVPASSEQ "$(bup index -s / | grep ^D)" ""
 tree3=$(bup save -t /)
 WVPASSEQ "$tree1" "$tree3"
-WVFAIL bup save -r localhost -n r-test $D
 WVPASS bup save -r :$BUP_DIR -n r-test $D
 WVFAIL bup save -r :$BUP_DIR/fake/path -n r-test $D
 WVFAIL bup save -r :$BUP_DIR -n r-test $D/fake/path
@@ -144,7 +143,7 @@ WVPASS bup midx -f
 WVPASS bup margin
 WVPASS bup split -t t/testfile2 >tags2t.tmp
 WVPASS bup split -t t/testfile2 --fanout 3 >tags2tf.tmp
-WVFAIL bup split -r $BUP_DIR -c t/testfile2 >tags2c.tmp
+WVPASS bup split -r "$BUP_DIR" -c t/testfile2 >tags2c.tmp
 WVPASS bup split -r :$BUP_DIR -c t/testfile2 >tags2c.tmp
 WVPASS ls -lR \
    | WVPASS bup split -r :$BUP_DIR -c --fanout 3 --max-pack-objects 3 -n lslr
@@ -166,7 +165,7 @@ WVSTART "join"
 WVPASS bup join $(cat tags1.tmp) >out1.tmp
 WVPASS bup join <tags2.tmp >out2.tmp
 WVPASS bup join <tags2t.tmp >out2t.tmp
-WVFAIL bup join -r "$BUP_DIR" <tags2c.tmp >out2c.tmp
+WVPASS bup join -r "$BUP_DIR" <tags2c.tmp >out2c.tmp
 WVPASS bup join -r ":$BUP_DIR" <tags2c.tmp >out2c.tmp
 WVPASS diff -u t/testfile1 out1.tmp
 WVPASS diff -u t/testfile2 out2.tmp