Changeset 778:69da34d8b14f in hatta-dev for hatta.py


Ignore:
Timestamp:
07/13/10 19:55:20 (23 months ago)
Author:
Radomir Dopieralski <hatta-dev@…>
Branch:
default
Message:

Fix AttributeError issue with Mercurial 1.6

File:
1 edited

Legend:

Unmodified
Added
Removed
  • hatta.py

    r775 r778  
    491491        changectx = self._changectx() 
    492492        try: 
     493            # Mercurial 1.5 and earlier have .add() on the repo 
     494            add = self.repo.add 
     495        except AttributeError: 
     496            # Mercurial 1.6 
     497            add = self.repo[None].add 
     498        try: 
    493499            filectx_tip = changectx[repo_file] 
    494500            current_page_rev = filectx_tip.filerev() 
    495501        except mercurial.revlog.LookupError: 
    496             self.repo.add([repo_file]) 
     502            add([repo_file]) 
    497503            current_page_rev = -1 
    498504        if parent is not None and current_page_rev != parent: 
     
    559565        self._check_path(file_path) 
    560566        try: 
     567            # Mercurial 1.5 and earlier have .remove() on the repo 
     568            remove = self.repo.remove 
     569        except AttributeError: 
     570            # Mercurial 1.6 
     571            remove = self.repo[None].remove 
     572        try: 
    561573            os.unlink(file_path) 
    562574        except OSError: 
    563575            pass 
    564         self.repo.remove([repo_file]) 
     576        remove([repo_file]) 
    565577        self._commit([repo_file], text, user) 
    566578 
Note: See TracChangeset for help on using the changeset viewer.