/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 bzrlib/add.py

  • Committer: Richard Wilbur
  • Date: 2016-02-04 19:07:28 UTC
  • mto: This revision was merged to the branch mainline in revision 6618.
  • Revision ID: richard.wilbur@gmail.com-20160204190728-p0zvfii6zase0fw7
Update COPYING.txt from the original http://www.gnu.org/licenses/gpl-2.0.txt  (Only differences were in whitespace.)  Thanks to Petr Stodulka for pointing out the discrepancy.

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
import sys
22
22
import os
23
23
 
24
 
from . import (
25
 
    errors,
 
24
from bzrlib import (
26
25
    osutils,
27
 
    ui,
 
26
    ui, 
28
27
    )
29
 
from .i18n import gettext
 
28
from bzrlib.i18n import gettext
30
29
 
31
30
class AddAction(object):
32
31
    """A class which defines what action to take when adding a file."""
128
127
        we look for a file with the same name in that directory.
129
128
        Else, we look for an entry in the base tree with the same path.
130
129
        """
131
 
        try:
132
 
            parent_path = self.base_tree.id2path(parent_ie.file_id)
133
 
        except errors.NoSuchId:
134
 
            pass
135
 
        else:
136
 
            base_path = osutils.pathjoin(parent_path, osutils.basename(path))
 
130
        if self.base_tree.has_id(parent_ie.file_id):
 
131
            base_path = osutils.pathjoin(
 
132
                self.base_tree.id2path(parent_ie.file_id),
 
133
                osutils.basename(path))
137
134
            base_id = self.base_tree.path2id(base_path)
138
135
            if base_id is not None:
139
136
                return (base_id, base_path)