Repository: borgbackup/borg

Issue:
borg recreate AttributeError: attribute time_end not found
I tried to change chunker params of an old repo that was migrated from attic.

```
tarantula!root# borg recreate -v --stats --compression zlib --chunker-params default /mnt/tarantula.atticbackup/tarantula.attic
Warning: Attempting to access a previously unknown unencrypted repository!                 
Do you want to continue? [yN] y              
recreate is an experimental feature.         
Type 'YES' if you understand this and want to continue: YES                                
Processing rdiff-root-2010-11-10T18:23:51+03:00                                            
Local Exception                              
Traceback (most recent call last):           
  File "/usr/lib/python3/dist-packages/borg/archiver.py", line 4024, in main               
    exit_code = archiver.run(args)           
  File "/usr/lib/python3/dist-packages/borg/archiver.py", line 3952, in run                
    return set_ec(func(args))                
  File "/usr/lib/python3/dist-packages/borg/archiver.py", line 146, in wrapper             
    return method(self, args, repository=repository, cache=cache_, **kwargs)               
  File "/usr/lib/python3/dist-packages/borg/archiver.py", line 1658, in do_recreate        
    if not recreater.recreate(name, args.comment):                                         
  File "/usr/lib/python3/dist-packages/borg/archive.py", line 1611, in recreate            
    self.save(archive, target, comment, replace_original=replace_original)                 
  File "/usr/lib/python3/dist-packages/borg/archive.py", line 1700, in save                
    'time_end': archive.metadata.time_end,   
  File "src/borg/item.pyx", line 99, in borg.item.PropDict._make_property._get (src/borg/item.c:3603)                                                                                 
AttributeError: attribute time_end not found 

Platform: Linux tarantula 4.13.0-12-generic #13-Ubuntu SMP Sat Sep 23 03:40:16 UTC 2017 x86_64 x86_64                                                                                 
Linux: Ubuntu 17.10 artful                   
Borg: 1.1.0  Python: CPython 3.6.3rc1        
PID: 14290  CWD: /home/baz                   
sys.argv: ['/usr/bin/borg', 'recreate', '-v', '--stats', '--compression', 'zlib', '--chunker-params', 'default', '/mnt/tarantula.atticbackup/tarantula.attic']                        
SSH_ORIGINAL_COMMAND: None                   
```


Discussion:
iirc, attic archives have no end time. but borg should not crash on that...

Resolving patch:
diff --git a/src/borg/archive.py b/src/borg/archive.py
--- a/src/borg/archive.py
+++ b/src/borg/archive.py
@@ -1697,7 +1697,7 @@ def save(self, archive, target, comment=None, replace_original=True):
         target.save(comment=comment, additional_metadata={
             # keep some metadata as in original archive:
             'time': archive.metadata.time,
-            'time_end': archive.metadata.time_end,
+            'time_end': archive.metadata.get('time_end') or archive.metadata.time,
             'cmdline': archive.metadata.cmdline,
             # but also remember recreate metadata:
             'recreate_cmdline': sys.argv,


Test patch: