From: Avery Pennarun Date: Tue, 9 Nov 2010 05:14:04 +0000 (-0800) Subject: Revert (most of) "--remote parameter requires a colon" X-Git-Tag: bup-0.20~1 X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?p=bup.git;a=commitdiff_plain;h=e3c617fdb6974ad754efb94fea828a9cf8312f9c Revert (most of) "--remote parameter requires a colon" 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 --- diff --git a/cmd/init-cmd.py b/cmd/init-cmd.py index e00574a..04f3248 100755 --- a/cmd/init-cmd.py +++ b/cmd/init-cmd.py @@ -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() diff --git a/cmd/join-cmd.py b/cmd/join-cmd.py index d2cc888..81febac 100755 --- a/cmd/join-cmd.py +++ b/cmd/join-cmd.py @@ -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() diff --git a/cmd/save-cmd.py b/cmd/save-cmd.py index c10c216..df51a6c 100755 --- a/cmd/save-cmd.py +++ b/cmd/save-cmd.py @@ -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: diff --git a/cmd/split-cmd.py b/cmd/split-cmd.py index 4155b24..035e8de 100755 --- a/cmd/split-cmd.py +++ b/cmd/split-cmd.py @@ -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: diff --git a/t/test.sh b/t/test.sh index 02590aa..4011cd9 100755 --- 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 out2.tmp WVPASS bup join out2t.tmp -WVFAIL bup join -r "$BUP_DIR" out2c.tmp +WVPASS bup join -r "$BUP_DIR" out2c.tmp WVPASS bup join -r ":$BUP_DIR" out2c.tmp WVPASS diff -u t/testfile1 out1.tmp WVPASS diff -u t/testfile2 out2.tmp