~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/_dirstate_helpers_py.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2008-06-05 04:05:05 UTC
  • mfrom: (3473.1.1 ianc-integration)
  • Revision ID: pqm@pqm.ubuntu.com-20080605040505-i9kqxg2fps2qjdi0
Add the 'alias' command (Tim Penhey)

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2007, 2008 Canonical Ltd
 
1
# Copyright (C) 2007 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
20
20
 
21
21
# We cannot import the dirstate module, because it loads this module
22
22
# All we really need is the IN_MEMORY_MODIFIED constant
23
 
from bzrlib import errors
24
23
from bzrlib.dirstate import DirState
25
24
 
26
25
 
202
201
    # Remove the last blank entry
203
202
    trailing = fields.pop()
204
203
    if trailing != '':
205
 
        raise errors.DirstateCorrupt(state,
206
 
            'trailing garbage: %r' % (trailing,))
 
204
        raise AssertionError("dirstate line %r has trailing garbage: %r" 
 
205
            % (trailing,))
207
206
    # consider turning fields into a tuple.
208
207
 
209
208
    # skip the first field which is the trailing null from the header.
221
220
    field_count = len(fields)
222
221
    # this checks our adjustment, and also catches file too short.
223
222
    if field_count - cur != expected_field_count:
224
 
        raise errors.DirstateCorrupt(state,
 
223
        raise AssertionError(
225
224
            'field count incorrect %s != %s, entry_size=%s, '\
226
225
            'num_entries=%s fields=%r' % (
227
226
            field_count - cur, expected_field_count, entry_size,
289
288
    # To convert from format 3 => format 2
290
289
    # state._dirblocks = sorted(state._dirblocks)
291
290
    state._dirblock_state = DirState.IN_MEMORY_UNMODIFIED
 
291