Skip to content

Commit b849baf

Browse files
committed
Add --exclude-if-uploaded-after sync option
1 parent 0fe3fe0 commit b849baf

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

b2/_internal/console_tool.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3007,6 +3007,8 @@ class Sync(
30073007
Ignored files or file versions will not be taken for consideration during sync.
30083008
The time should be given as a seconds timestamp (e.g. "1367900664")
30093009
If you need milliseconds precision, put it after the comma (e.g. "1367900664.152")
3010+
Alternatively you can specify ``--exclude-if-uploaded-after`` to use the server-side
3011+
object creation timestamp rather than the modification time declared by the client.
30103012
30113013
Files are considered to be the same if they have the same name
30123014
and modification time. This behaviour can be changed using the
@@ -3124,6 +3126,13 @@ def _setup_parser(cls, parser):
31243126
default=None,
31253127
metavar='TIMESTAMP'
31263128
)
3129+
add_normalized_argument(
3130+
parser,
3131+
'--exclude-if-uploaded-after',
3132+
type=parse_millis_from_float_timestamp,
3133+
default=None,
3134+
metavar='TIMESTAMP'
3135+
)
31273136
super()._setup_parser(parser) # add parameters from the mixins, and the parent class
31283137
parser.add_argument('source')
31293138
parser.add_argument('destination')
@@ -3217,6 +3226,7 @@ def get_policies_manager_from_args(self, args):
32173226
include_file_regexes=args.include_regex,
32183227
exclude_all_symlinks=args.exclude_all_symlinks,
32193228
exclude_modified_after=args.exclude_if_modified_after,
3229+
exclude_uploaded_after=args.exclude_if_uploaded_after,
32203230
)
32213231

32223232
def get_synchronizer_from_args(

changelog.d/+9092be80.added.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Add `--exclude-if-uploaded-after` to `sync`

0 commit comments

Comments
 (0)