~mnordhoff/loggerhead/cheezum

« back to all changes in this revision

Viewing changes to loggerhead/config.py

Bring in the merge_point_config code.

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
def _get_temporary_sql_dir():
25
25
    global _temporary_sql_dir
26
26
    if _temporary_sql_dir is None:
 
27
        # XXX: Shouldn't this be registering an atexit hook to delete the
 
28
        #      directory? Otherwise we fill up /tmp with caches that we won't
 
29
        #      ever use again...
27
30
        _temporary_sql_dir = tempfile.mkdtemp(prefix='loggerhead-cache-')
28
31
    return _temporary_sql_dir
29
32
 
69
72
                      help="The directory to place the SQL cache in")
70
73
    parser.add_option("--allow-writes", action="store_true",
71
74
                      help="Allow writing to the Bazaar server.")
 
75
    parser.add_option("--show-merge-points", action="store_true", default=True,
 
76
                      help="When showing a revision, show where it"
 
77
                           " was merged.")
 
78
    parser.add_option("--no-show-merge-points", action="store_false",
 
79
                      dest='show_merge_points',
 
80
                      help="Do not show where revisions are merged")
72
81
    return parser
73
82
 
74
83
 
92
101
        All loggerhead-specific settings start with 'http_'
93
102
        """
94
103
        global_config = config.GlobalConfig().get_user_option('http_'+option)
95
 
        cmd_config = getattr(self._options, option)
 
104
        cmd_config = getattr(self._options, option, None)
96
105
        if global_config is not None and (
97
106
            cmd_config is None or cmd_config is False):
98
107
            return global_config