mercurial/subrepo.py
branchstable
changeset 21566 a01988cd9b61
parent 21565 7f7f634d073d
child 21567 5900bc09e684
equal deleted inserted replaced
21565:7f7f634d073d 21566:a01988cd9b61
  1048             args.append('--force')
  1048             args.append('--force')
  1049         # The revision must be specified at the end of the URL to properly
  1049         # The revision must be specified at the end of the URL to properly
  1050         # update to a directory which has since been deleted and recreated.
  1050         # update to a directory which has since been deleted and recreated.
  1051         args.append('%s@%s' % (state[0], state[1]))
  1051         args.append('%s@%s' % (state[0], state[1]))
  1052         status, err = self._svncommand(args, failok=True)
  1052         status, err = self._svncommand(args, failok=True)
  1053         _sanitize(self._ui, self._path)
  1053         _sanitize(self._ui, self._ctx._repo.wjoin(self._path))
  1054         if not re.search('Checked out revision [0-9]+.', status):
  1054         if not re.search('Checked out revision [0-9]+.', status):
  1055             if ('is already a working copy for a different URL' in err
  1055             if ('is already a working copy for a different URL' in err
  1056                 and (self._wcchanged()[:2] == (False, False))):
  1056                 and (self._wcchanged()[:2] == (False, False))):
  1057                 # obstructed but clean working copy, so just blow it away.
  1057                 # obstructed but clean working copy, so just blow it away.
  1058                 self.remove()
  1058                 self.remove()
  1341                 # the -f option will otherwise throw away files added for
  1341                 # the -f option will otherwise throw away files added for
  1342                 # commit, not just unmark them.
  1342                 # commit, not just unmark them.
  1343                 self._gitcommand(['reset', 'HEAD'])
  1343                 self._gitcommand(['reset', 'HEAD'])
  1344                 cmd.append('-f')
  1344                 cmd.append('-f')
  1345             self._gitcommand(cmd + args)
  1345             self._gitcommand(cmd + args)
  1346             _sanitize(self._ui, self._path)
  1346             _sanitize(self._ui, self._abspath)
  1347 
  1347 
  1348         def rawcheckout():
  1348         def rawcheckout():
  1349             # no branch to checkout, check it out with no branch
  1349             # no branch to checkout, check it out with no branch
  1350             self._ui.warn(_('checking out detached HEAD in subrepo %s\n') %
  1350             self._ui.warn(_('checking out detached HEAD in subrepo %s\n') %
  1351                           self._relpath)
  1351                           self._relpath)
  1390             # Since we are only looking at branching at update, we need to
  1390             # Since we are only looking at branching at update, we need to
  1391             # detect this situation and perform this action lazily.
  1391             # detect this situation and perform this action lazily.
  1392             if tracking[remote] != self._gitcurrentbranch():
  1392             if tracking[remote] != self._gitcurrentbranch():
  1393                 checkout([tracking[remote]])
  1393                 checkout([tracking[remote]])
  1394             self._gitcommand(['merge', '--ff', remote])
  1394             self._gitcommand(['merge', '--ff', remote])
  1395             _sanitize(self._ui, self._path)
  1395             _sanitize(self._ui, self._abspath)
  1396         else:
  1396         else:
  1397             # a real merge would be required, just checkout the revision
  1397             # a real merge would be required, just checkout the revision
  1398             rawcheckout()
  1398             rawcheckout()
  1399 
  1399 
  1400     @annotatesubrepoerror
  1400     @annotatesubrepoerror
  1426         def mergefunc():
  1426         def mergefunc():
  1427             if base == revision:
  1427             if base == revision:
  1428                 self.get(state) # fast forward merge
  1428                 self.get(state) # fast forward merge
  1429             elif base != self._state[1]:
  1429             elif base != self._state[1]:
  1430                 self._gitcommand(['merge', '--no-commit', revision])
  1430                 self._gitcommand(['merge', '--no-commit', revision])
  1431             _sanitize(self._ui, self._path)
  1431             _sanitize(self._ui, self._abspath)
  1432 
  1432 
  1433         if self.dirty():
  1433         if self.dirty():
  1434             if self._gitstate() != revision:
  1434             if self._gitstate() != revision:
  1435                 dirty = self._gitstate() == self._state[1] or code != 0
  1435                 dirty = self._gitstate() == self._state[1] or code != 0
  1436                 if _updateprompt(self._ui, self, dirty,
  1436                 if _updateprompt(self._ui, self, dirty,