Changeset 510 in tailor
- Timestamp:
- 08/06/05 18:07:24 (8 years ago)
- Hash name:
- 20050806160724-97f81-dee22ebf3bd9a25f8ae7a1c71c461347426b6414
- File:
-
- 1 edited
-
vcpx/changes.py (modified) (10 diffs)
Legend:
- Unmodified
- Added
- Removed
-
vcpx/changes.py
r474 r510 1 1 # -*- mode: python; coding: utf-8 -*- 2 # :Progetto: vcpx -- Changesets 2 # :Progetto: vcpx -- Changesets 3 3 # :Creato: ven 11 giu 2004 15:31:18 CEST 4 4 # :Autore: Lele Gaifax <lele@nautilus.homeip.net> 5 5 # :Licenza: GNU General Public License 6 # 6 # 7 7 8 8 """ … … 21 21 to indicate possible conflicts. 22 22 """ 23 23 24 24 ADDED = 'ADD' 25 25 DELETED = 'DEL' … … 29 29 APPLIED = 'APPLIED' 30 30 CONFLICT = 'CONFLICT' 31 31 32 32 def __init__(self, name): 33 33 self.name = name … … 53 53 from textwrap import TextWrapper 54 54 from re import compile, MULTILINE 55 55 56 56 itemize_re = compile('^[ ]*[-*] ', MULTILINE) 57 57 … … 64 64 starting with either a dash "-" or an asterisk "*". 65 65 """ 66 66 67 67 wrapper = TextWrapper() 68 68 res = [] 69 69 items = itemize_re.split(msg.strip()) 70 70 71 71 if len(items)>1: 72 72 # Remove possible first empty split, when the message immediately … … 74 74 if not items[0]: 75 75 del items[0] 76 76 77 77 if len(items)>1: 78 78 wrapper.initial_indent = '- ' 79 79 wrapper.subsequent_indent = ' '*2 80 80 81 81 for item in items: 82 82 if item: … … 100 100 REFILL_MESSAGE = True 101 101 """Refill changelogs""" 102 102 103 103 def __init__(self, revision, date, author, log, entries=None, **other): 104 104 """ 105 105 Initialize a new Changeset. 106 106 """ 107 107 108 108 self.revision = revision 109 109 self.date = date … … 127 127 self.entries.append(e) 128 128 return e 129 129 130 130 def __str__(self): 131 131 s = [] … … 149 149 Apply the changeset using ``patch(1)`` to a given directory. 150 150 """ 151 151 152 152 from shwrap import ExternalCommand 153 153 from source import ChangesetApplicationFailure … … 163 163 patch = ExternalCommand(cwd=working_dir, command=cmd) 164 164 patch.execute(input=self.unidiff) 165 165 166 166 if patch.exit_status: 167 167 raise ChangesetApplicationFailure( 168 168 "%s returned status %s" % (str(patch), patch.exit_status)) 169 169 170 170 def addedEntries(self): 171 171 """ 172 172 Facility to extract a list of added entries. 173 173 """ 174 174 175 175 return [e for e in self.entries if e.action_kind == e.ADDED] 176 176
Note: See TracChangeset
for help on using the changeset viewer.
