/breezy/3.0

To get this branch, use:
bzr branch https://code.breezy-vcs.org/breezy/3.0

« back to all changes in this revision

Viewing changes to breezy/plugins/fastimport/helpers.py

  • Committer: Breezy landing bot
  • Author(s): Jelmer Vernooij
  • Date: 2018-05-07 12:03:11 UTC
  • mfrom: (6929.13.6 fast-import-cmds)
  • Revision ID: breezy.the.bot@gmail.com-20180507120311-x2v52qsrqj93zi52
Remove the fast-import-{query,info,filter} commands.

Merged from https://code.launchpad.net/~jelmer/brz/fast-import-cmds/+merge/342461

Show diffs side-by-side

added added

removed removed

Lines of Context:
178
178
        return single
179
179
    else:
180
180
        return plural
181
 
 
182
 
 
183
 
def invert_dictset(d):
184
 
    """Invert a dictionary with keys matching a set of values, turned into lists."""
185
 
    # Based on recipe from ASPN
186
 
    result = {}
187
 
    for k, c in d.items():
188
 
        for v in c:
189
 
            keys = result.setdefault(v, [])
190
 
            keys.append(k)
191
 
    return result
192
 
 
193
 
 
194
 
def invert_dict(d):
195
 
    """Invert a dictionary with keys matching each value turned into a list."""
196
 
    # Based on recipe from ASPN
197
 
    result = {}
198
 
    for k, v in d.items():
199
 
        keys = result.setdefault(v, [])
200
 
        keys.append(k)
201
 
    return result
202
 
 
203