/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/cmdline.py

  • Committer: Gustav Hartvigsson
  • Date: 2021-01-09 21:36:27 UTC
  • Revision ID: gustav.hartvigsson@gmail.com-20210109213627-h1xwcutzy9m7a99b
Added 'Case Preserving Working Tree Use Cases' from Canonical Wiki

* Addod a page from the Canonical Bazaar wiki
  with information on the scmeatics of case
  perserving filesystems an a case insensitive
  filesystem works.
  
  * Needs re-work, but this will do as it is the
    same inforamoton as what was on the linked
    page in the currint documentation.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2010 Canonical Ltd
 
1
# Copyright (C) 2010-2011 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
14
14
# along with this program; if not, write to the Free Software
15
15
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16
16
 
17
 
"""Unicode-compatible command-line splitter for all platforms."""
 
17
"""Unicode-compatible command-line splitter for all platforms.
 
18
 
 
19
The user-visible behaviour of this module is described in
 
20
configuring_bazaar.txt.
 
21
"""
18
22
 
19
23
import re
20
24
 
21
25
 
22
 
_whitespace_match = re.compile(u'\s', re.UNICODE).match
 
26
_whitespace_match = re.compile(u'\\s', re.UNICODE).match
23
27
 
24
28
 
25
29
class _PushbackSequence(object):
27
31
        self._iter = iter(orig)
28
32
        self._pushback_buffer = []
29
33
 
30
 
    def next(self):
 
34
    def __next__(self):
31
35
        if len(self._pushback_buffer) > 0:
32
36
            return self._pushback_buffer.pop()
33
37
        else:
34
 
            return self._iter.next()
 
38
            return next(self._iter)
 
39
 
 
40
    next = __next__
35
41
 
36
42
    def pushback(self, char):
37
43
        self._pushback_buffer.append(char)
66
72
        if next_char == u'\\':
67
73
            return _Backslash(self)
68
74
        elif next_char == self.quote_char:
 
75
            context.token.append(u'')
69
76
            return self.exit_state
70
77
        else:
71
78
            context.token.append(next_char)
84
91
            return self
85
92
        elif next_char in context.allowed_quote_chars:
86
93
            # 2N backslashes followed by a quote are N backslashes
87
 
            context.token.append(u'\\' * (self.count/2))
 
94
            context.token.append(u'\\' * (self.count // 2))
88
95
            # 2N+1 backslashes follwed by a quote are N backslashes followed by
89
96
            # the quote which should not be processed as the start or end of
90
97
            # the quoted arg
133
140
    def __iter__(self):
134
141
        return self
135
142
 
136
 
    def next(self):
 
143
    def __next__(self):
137
144
        quoted, token = self._get_token()
138
145
        if token is None:
139
146
            raise StopIteration
140
147
        return quoted, token
141
148
 
 
149
    next = __next__
 
150
 
142
151
    def _get_token(self):
143
152
        self.quoted = False
144
153
        self.token = []
147
156
            state = state.process(next_char, self)
148
157
            if state is None:
149
158
                break
150
 
        if not state is None and not getattr(state, 'finish', None) is None:
 
159
        if state is not None and not getattr(state, 'finish', None) is None:
151
160
            state.finish(self)
152
161
        result = u''.join(self.token)
153
162
        if not self.quoted and result == '':