- copied from bzr repository