/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 breezy/plugins/fastimport/helpers.py

Merge test-run support.

Show diffs side-by-side

added added

removed removed

Lines of Context:
54
54
    """
55
55
    # Based on code from breezy/info.py ...
56
56
    repo_format = repo._format
57
 
    candidates = []
 
57
    candidates  = []
58
58
    non_aliases = set(controldir.format_registry.keys())
59
59
    non_aliases.difference_update(controldir.format_registry.aliases())
60
60
    for key in non_aliases:
97
97
        contents = os.listdir(location)
98
98
        if contents:
99
99
            errors.BzrCommandError("Destination must have a .bzr directory, "
100
 
                                   " not yet exist or be empty - files found in %s" % (location,))
 
100
                " not yet exist or be empty - files found in %s" % (location,))
101
101
    else:
102
102
        try:
103
103
            os.mkdir(location)
104
104
        except IOError as ex:
105
 
            raise errors.BzrCommandError(
106
 
                "Unable to create %s: %s" % (location, ex))
 
105
            errors.BzrCommandError("Unable to create %s: %s" %
 
106
                (location, ex))
107
107
 
108
108
    # Create a repository for the nominated format.
109
109
    trace.note("Creating destination repository ...")
121
121
 
122
122
def kind_to_mode(kind, executable):
123
123
    if kind == "file":
124
 
        if executable is True:
 
124
        if executable == True:
125
125
            return stat.S_IFREG | 0o755
126
 
        elif executable is False:
 
126
        elif executable == False:
127
127
            return stat.S_IFREG | 0o644
128
128
        else:
129
129
            raise AssertionError("Executable %r invalid" % executable)