diff options
author | Lars Wirzenius <liw@liw.fi> | 2014-02-23 17:26:44 +0000 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2014-02-23 17:26:44 +0000 |
commit | a20569f65d36b36a3810a3ada1a2cf3a95eadee5 (patch) | |
tree | 24702830e80f6133f7f298cac154a291c6852835 /obnamlib/plugins/fuse_plugin.py | |
parent | 611ecfdd883123a02b8a703f1995db385640a629 (diff) | |
download | obnam-a20569f65d36b36a3810a3ada1a2cf3a95eadee5.tar.gz |
Remove now-unnecessary if (from viewmode deletion)
Diffstat (limited to 'obnamlib/plugins/fuse_plugin.py')
-rw-r--r-- | obnamlib/plugins/fuse_plugin.py | 51 |
1 files changed, 25 insertions, 26 deletions
diff --git a/obnamlib/plugins/fuse_plugin.py b/obnamlib/plugins/fuse_plugin.py index 0beb86a7..c7504518 100644 --- a/obnamlib/plugins/fuse_plugin.py +++ b/obnamlib/plugins/fuse_plugin.py @@ -323,33 +323,32 @@ class ObnamFuse(fuse.Fuse): mountroot = self.obnam.mountroot generations = self.obnam.app.settings['generation'] - if True: - # we need the list of all real (non-checkpoint) generations - if len(generations) == 1: - generations = [gen for gen in repo.list_generations() - if not repo.get_is_checkpoint(gen)] - - if mountroot == '/': - def gen_path_0(path): - if path.count('/') == 1: - gen = path[1:] - return (int(gen), mountroot) - else: - gen, repopath = path[1:].split('/', 1) - return (int(gen), mountroot + repopath) - self.get_gen_path = gen_path_0 - else: - def gen_path_n(path): - if path.count('/') == 1: - gen = path[1:] - return (int(gen), mountroot) - else: - gen, repopath = path[1:].split('/', 1) - return (int(gen), mountroot + '/' + repopath) - self.get_gen_path = gen_path_n + # we need the list of all real (non-checkpoint) generations + if len(generations) == 1: + generations = [gen for gen in repo.list_generations() + if not repo.get_is_checkpoint(gen)] - self.rootstat, self.rootlist = self.multiple_root_list(generations) - tracing.trace('multiple rootlist=%r', self.rootlist) + if mountroot == '/': + def gen_path_0(path): + if path.count('/') == 1: + gen = path[1:] + return (int(gen), mountroot) + else: + gen, repopath = path[1:].split('/', 1) + return (int(gen), mountroot + repopath) + self.get_gen_path = gen_path_0 + else: + def gen_path_n(path): + if path.count('/') == 1: + gen = path[1:] + return (int(gen), mountroot) + else: + gen, repopath = path[1:].split('/', 1) + return (int(gen), mountroot + '/' + repopath) + self.get_gen_path = gen_path_n + + self.rootstat, self.rootlist = self.multiple_root_list(generations) + tracing.trace('multiple rootlist=%r', self.rootlist) def __init__(self, *args, **kw): self.obnam = kw['obnam'] |