]> arthur.barton.de Git - bup.git/commit
Add repo abstraction and use it in join
authorRob Browning <rlb@defaultvalue.org>
Tue, 13 Jun 2017 06:44:45 +0000 (01:44 -0500)
committerRob Browning <rlb@defaultvalue.org>
Sun, 24 Sep 2017 17:19:01 +0000 (12:19 -0500)
commit8263f03e1d7192359e82294f6d3379efd4e487b8
treed0f85a9595a233fcc60b814393480c4fdd2b25b1
parent95612d35195fbf93d4cac7d6f35b6258f28ca3ea
Add repo abstraction and use it in join

Operations that can be --remote currently rely on code like this:

  if opt.remote:
      cli = client.Client(opt.remote)
      cat = cli.cat
  else:
      cp = git.CatPipe()
      cat = cp.join

Instead, add LocalRepo and RemoteRepo classes with matching methods so
that we can say:

  repo = RemoteRepo(opt.remote) if opt.remote else LocalRepo()

and then use repo methods to handle the work.

Rework "bup join" accordingly.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>
cmd/join-cmd.py
lib/bup/repo.py [new file with mode: 0644]