~ubuntu-branches/ubuntu/lucid/mercurial/lucid

« back to all changes in this revision

Viewing changes to hgext/convert/gnuarch.py

  • Committer: Bazaar Package Importer
  • Author(s): Vernon Tang
  • Date: 2009-01-18 10:39:58 UTC
  • mfrom: (8.1.1 sid)
  • Revision ID: james.westby@ubuntu.com-20090118103958-4ep2fqb5nl2pyc7y
Tags: 1.1.2-2
* debian/mercurial.postinst: symlink /usr/share/doc/mercurial if dpkg didn't
  do it when upgrading (closes: #512155)
* debian/control: mercurial-common replaces all earlier versions of
  mercurial

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
        super(gnuarch_source, self).__init__(ui, path, rev=rev)
24
24
 
25
25
        if not os.path.exists(os.path.join(path, '{arch}')):
26
 
            raise NoRepo(_("%s does not look like a GNU Arch repo" % path))
 
26
            raise NoRepo(_("%s does not look like a GNU Arch repo") % path)
27
27
 
28
28
        # Could use checktool, but we want to check for baz or tla.
29
29
        self.execmd = None
54
54
            output = self.run0('tree-version', '-d', self.path)
55
55
        self.treeversion = output.strip()
56
56
 
57
 
        self.ui.status(_('analyzing tree version %s...\n' % self.treeversion))
 
57
        self.ui.status(_('analyzing tree version %s...\n') % self.treeversion)
58
58
 
59
59
        # Get name of temporary directory
60
60
        version = self.treeversion.split('/')
80
80
        self.parents[None] = child
81
81
 
82
82
    def after(self):
83
 
        self.ui.debug(_('cleaning up %s\n' % self.tmppath))
 
83
        self.ui.debug(_('cleaning up %s\n') % self.tmppath)
84
84
        shutil.rmtree(self.tmppath, ignore_errors=True)
85
85
 
86
86
    def getheads(self):
130
130
            for c in cps:
131
131
                copies[c] = cps[c]
132
132
 
133
 
        changes.sort()
134
133
        self.lastrev = rev
135
 
 
136
 
        return changes, copies
 
134
        return util.sort(changes), copies
137
135
 
138
136
    def getcommit(self, rev):
139
137
        changes = self.changes[rev]
157
155
            # Initialise 'base-0' revision
158
156
            self._obtainrevision(rev)
159
157
        else:
160
 
            self.ui.debug(_('applying revision %s...\n' % rev))
 
158
            self.ui.debug(_('applying revision %s...\n') % rev)
161
159
            revision = '%s--%s' % (self.treeversion, rev)
162
160
            changeset, status = self.runlines('replay', '-d', self.tmppath,
163
161
                                              revision)
168
166
                self._obtainrevision(rev)
169
167
            else:
170
168
                old_rev = self.parents[rev][0]
171
 
                self.ui.debug(_('computing changeset between %s and %s...\n' \
172
 
                                    % (old_rev, rev)))
 
169
                self.ui.debug(_('computing changeset between %s and %s...\n')
 
170
                              % (old_rev, rev))
173
171
                rev_a = '%s--%s' % (self.treeversion, old_rev)
174
172
                rev_b = '%s--%s' % (self.treeversion, rev)
175
173
                self._parsechangeset(changeset, rev)
219
217
        return changes, copies
220
218
 
221
219
    def _obtainrevision(self, rev):
222
 
        self.ui.debug(_('obtaining revision %s...\n' % rev))
 
220
        self.ui.debug(_('obtaining revision %s...\n') % rev)
223
221
        revision = '%s--%s' % (self.treeversion, rev)
224
222
        output = self._execute('get', revision, self.tmppath)
225
223
        self.checkexit(output)
226
 
        self.ui.debug(_('analysing revision %s...\n' % rev))
 
224
        self.ui.debug(_('analysing revision %s...\n') % rev)
227
225
        files = self._readcontents(self.tmppath)
228
226
        self.changes[rev].add_files += files
229
227