:
'''Start a new generation. The new generation is a copy-on-write clone of the previous one (or empty, if first generation). '''
tracing.trace('start new generation')
self.require_client_lock()
if self.new_generation isnotNone:
raise obnamlib.Error('Cannot start two new generations')
self.client.start_generation()
self.new_generation = \
self.client.get_generation_id(self.client.tree)
self.added_generations.append(self.new_generation)
return self.new_generation