/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

  • Committer: Jelmer Vernooij
  • Date: 2019-05-29 03:22:34 UTC
  • mfrom: (7303 work)
  • mto: This revision was merged to the branch mainline in revision 7306.
  • Revision ID: jelmer@jelmer.uk-20190529032234-mt3fuws8gq03tapi
Merge trunk.

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
 
            errors.BzrCommandError("Unable to create %s: %s" %
106
 
                (location, ex))
 
105
            raise errors.BzrCommandError(
 
106
                "Unable to create %s: %s" % (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 == True:
 
124
        if executable is True:
125
125
            return stat.S_IFREG | 0o755
126
 
        elif executable == False:
 
126
        elif executable is False:
127
127
            return stat.S_IFREG | 0o644
128
128
        else:
129
129
            raise AssertionError("Executable %r invalid" % executable)