~ubuntu-branches/debian/stretch/bzr-xmloutput/stretch

« back to all changes in this revision

Viewing changes to statusxml.py

  • Committer: Bazaar Package Importer
  • Author(s): Jelmer Vernooij
  • Date: 2009-05-05 17:26:54 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20090505172654-hh5w1j0cv1k8k5km
Tags: 0.8.3+bzr123-1
* Move to section vcs.
* Bump standards version to 3.8.1.
* New upstream snapshot.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
#!/usr/bin/env python
2
2
# -*- encoding: utf-8 -*-
3
 
# Copyright (C) 2007 Guillermo Gonzalez
 
3
# Copyright (C) 2007, 2008, 2009 Guillermo Gonzalez
4
4
#
5
5
# The code taken from bzrlib is under: Copyright (C) 2005, 2006, 2007 Canonical Ltd
6
6
#
140
140
        old.lock_read()
141
141
        new.lock_read()
142
142
        try:
143
 
            try: 
144
 
                diff._raise_if_nonexistent(specific_files, old, new)
 
143
            nonexistents = None
 
144
            try:
 
145
                specific_files, nonexistents \
 
146
                        = status._filter_nonexistent(specific_files, old, new)
145
147
            except AttributeError:
146
 
                status._raise_if_nonexistent(specific_files, old, new)
 
148
                try:
 
149
                    diff._raise_if_nonexistent(specific_files, old, new)
 
150
                except AttributeError:
 
151
                    status._raise_if_nonexistent(specific_files, old, new)
147
152
            want_unversioned = not versioned
148
153
            to_file.write('<?xml version="1.0" encoding="UTF-8"?>')
149
154
            to_file.write('<status workingtree_root="%s">' % \
159
164
                       show_ids=show_ids,
160
165
                       show_unchanged=show_unchanged, 
161
166
                       show_unversioned=want_unversioned)
162
 
            conflict_title = False
163
 
            # show the new conflicts only for now. XXX: get them from the delta.
 
167
            # show the new conflicts only for now. XXX: get them from the 
 
168
            # delta.
164
169
            conflicts = new.conflicts()
165
170
            if specific_files is not None:
166
171
                conflicts = conflicts.select_conflicts(new, specific_files,
171
176
                    to_file.write('<conflict type="%s">%s</conflict>' % 
172
177
                                  (conflict.typestring, _escape_cdata(conflict.path)))
173
178
                to_file.write("</conflicts>")
 
179
            if nonexistents:
 
180
                to_file.write('<nonexistents>')
 
181
                tag = 'nonexistent'
 
182
                for nonexistent in nonexistents:
 
183
                    to_file.write('<%s>%s</%s>' % (tag, nonexistent, tag))
 
184
                to_file.write('</nonexistents>')
174
185
            if new_is_working_tree and show_pending:
175
186
                show_pending_merges(new, to_file)
176
187
            to_file.write('</status>')