~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/shelf.py

  • Committer: Jelmer Vernooij
  • Date: 2011-09-18 14:57:54 UTC
  • mto: This revision was merged to the branch mainline in revision 6149.
  • Revision ID: jelmer@samba.org-20110918145754-m3eow9ajl0pj2goe
SetĀ supports_nesting_repositories.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2008 Canonical Ltd
 
1
# Copyright (C) 2008, 2009, 2010 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
18
18
import errno
19
19
import re
20
20
 
 
21
from bzrlib.lazy_import import lazy_import
 
22
lazy_import(globals(), """
21
23
from bzrlib import (
22
24
    bencode,
23
25
    errors,
26
28
    pack,
27
29
    transform,
28
30
)
 
31
""")
29
32
 
30
33
 
31
34
class ShelfCreator(object):
62
65
        """Iterable of tuples describing shelvable changes.
63
66
 
64
67
        As well as generating the tuples, this updates several members.
65
 
        Tuples may be:
 
68
        Tuples may be::
 
69
 
66
70
           ('add file', file_id, work_kind, work_path)
67
71
           ('delete file', file_id, target_kind, target_path)
68
72
           ('rename', file_id, target_path, work_path)
78
82
            # when a tree root was deleted / renamed.
79
83
            if kind[0] is None and names[1] == '':
80
84
                continue
 
85
            # Also don't shelve deletion of tree root.
 
86
            if kind[1] is None and names[0] == '':
 
87
                continue
81
88
            if kind[0] is None or versioned[0] == False:
82
89
                self.creation[file_id] = (kind[1], names[1], parents[1],
83
90
                                          versioned)