mirror of https://github.com/borgbackup/borg.git
Merge pull request #2400 from ThomasWaldmann/rename-with-placeholders-1.0
borg rename: expand placeholders, fixes #2386
This commit is contained in:
commit
1cf4740c59
|
@ -24,7 +24,8 @@ from .helpers import Error, location_validator, archivename_validator, format_li
|
||||||
PathPrefixPattern, to_localtime, timestamp, safe_timestamp, bin_to_hex, get_cache_dir, prune_within, prune_split, \
|
PathPrefixPattern, to_localtime, timestamp, safe_timestamp, bin_to_hex, get_cache_dir, prune_within, prune_split, \
|
||||||
Manifest, NoManifestError, remove_surrogates, format_archive, check_extension_modules, Statistics, \
|
Manifest, NoManifestError, remove_surrogates, format_archive, check_extension_modules, Statistics, \
|
||||||
dir_is_tagged, bigint_to_int, ChunkerParams, CompressionSpec, PrefixSpec, is_slow_msgpack, yes, sysinfo, \
|
dir_is_tagged, bigint_to_int, ChunkerParams, CompressionSpec, PrefixSpec, is_slow_msgpack, yes, sysinfo, \
|
||||||
EXIT_SUCCESS, EXIT_WARNING, EXIT_ERROR, log_multi, PatternMatcher, ErrorIgnoringTextIOWrapper, set_ec
|
EXIT_SUCCESS, EXIT_WARNING, EXIT_ERROR, log_multi, PatternMatcher, ErrorIgnoringTextIOWrapper, set_ec, \
|
||||||
|
replace_placeholders
|
||||||
from .helpers import signal_handler, raising_signal_handler, SigHup, SigTerm
|
from .helpers import signal_handler, raising_signal_handler, SigHup, SigTerm
|
||||||
from .logger import create_logger, setup_logging
|
from .logger import create_logger, setup_logging
|
||||||
logger = create_logger()
|
logger = create_logger()
|
||||||
|
@ -494,7 +495,8 @@ class Archiver:
|
||||||
@with_archive
|
@with_archive
|
||||||
def do_rename(self, args, repository, manifest, key, cache, archive):
|
def do_rename(self, args, repository, manifest, key, cache, archive):
|
||||||
"""Rename an existing archive"""
|
"""Rename an existing archive"""
|
||||||
archive.rename(args.name)
|
name = replace_placeholders(args.name)
|
||||||
|
archive.rename(name)
|
||||||
manifest.write()
|
manifest.write()
|
||||||
repository.commit()
|
repository.commit()
|
||||||
cache.commit()
|
cache.commit()
|
||||||
|
|
Loading…
Reference in New Issue