/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to mapping.py

Cope with -0000 as timezone in Git commits.

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
from bzrlib import (
25
25
    errors,
26
26
    foreign,
27
 
    osutils,
28
27
    trace,
29
 
    urlutils,
30
28
    )
31
29
try:
32
30
    from bzrlib import bencode
248
246
            commit.author_time = long(rev.properties['author-timestamp'])
249
247
        else:
250
248
            commit.author_time = commit.commit_time
 
249
        commit._commit_timezone_neg_utc = "commit-timezone-neg-utc" in rev.properties
251
250
        commit.commit_timezone = rev.timezone
 
251
        commit._author_timezone_neg_utc = "author-timezone-neg-utc" in rev.properties
252
252
        if 'author-timezone' in rev.properties:
253
253
            commit.author_timezone = int(rev.properties['author-timezone'])
254
254
        else:
290
290
            rev.properties['author-timestamp'] = str(commit.author_time)
291
291
        if commit.commit_timezone != commit.author_timezone:
292
292
            rev.properties['author-timezone'] = "%d" % commit.author_timezone
 
293
        if commit._author_timezone_neg_utc:
 
294
            rev.properties['author-timezone-neg-utc'] = ""
 
295
        if commit._commit_timezone_neg_utc:
 
296
            rev.properties['commit-timezone-neg-utc'] = ""
293
297
        rev.timestamp = commit.commit_time
294
298
        rev.timezone = commit.commit_timezone
295
299
        return rev