##// END OF EJS Templates
subrepo/svn: fix checked out rev number retrieval (issue2968)...
Patrick Mezard -
r16554:ae2664ee stable
parent child Browse files
Show More
@@ -715,13 +715,24 b' class svnsubrepo(abstractsubrepo):'
715 return True
715 return True
716
716
717 def basestate(self):
717 def basestate(self):
718 return self._wcrev()
718 lastrev, rev = self._wcrevs()
719 if lastrev != rev:
720 # Last committed rev is not the same than rev. We would
721 # like to take lastrev but we do not know if the subrepo
722 # URL exists at lastrev. Test it and fallback to rev it
723 # is not there.
724 try:
725 self._svncommand(['info', '%s@%s' % (self._state[0], lastrev)])
726 return lastrev
727 except error.Abort:
728 pass
729 return rev
719
730
720 def commit(self, text, user, date):
731 def commit(self, text, user, date):
721 # user and date are out of our hands since svn is centralized
732 # user and date are out of our hands since svn is centralized
722 changed, extchanged, missing = self._wcchanged()
733 changed, extchanged, missing = self._wcchanged()
723 if not changed:
734 if not changed:
724 return self._wcrev()
735 return self.basestate()
725 if extchanged:
736 if extchanged:
726 # Do not try to commit externals
737 # Do not try to commit externals
727 raise util.Abort(_('cannot commit svn externals'))
738 raise util.Abort(_('cannot commit svn externals'))
@@ -564,3 +564,42 b' traceback'
564 $ hg forget 'notafile*'
564 $ hg forget 'notafile*'
565 notafile*: No such file or directory
565 notafile*: No such file or directory
566 [1]
566 [1]
567
568 Test a subrepo referencing a just moved svn path. Last commit rev will
569 be different from the revision, and the path will be different as
570 well.
571
572 $ cd $WCROOT
573 $ svn up > /dev/null
574 $ mkdir trunk/subdir branches
575 $ echo a > trunk/subdir/a
576 $ svn add trunk/subdir branches
577 A trunk/subdir
578 A trunk/subdir/a
579 A branches
580 $ svn ci -m addsubdir
581 Adding branches
582 Adding trunk/subdir
583 Adding trunk/subdir/a
584 Transmitting file data .
585 Committed revision 14.
586 $ svn cp -m branchtrunk $SVNREPO/trunk $SVNREPO/branches/somebranch
587
588 Committed revision 15.
589 $ cd ..
590
591 $ hg init repo2
592 $ cd repo2
593 $ svn co $SVNREPO/branches/somebranch/subdir
594 A subdir/a
595 Checked out revision 15.
596 $ echo "subdir = [svn] $SVNREPO/branches/somebranch/subdir" > .hgsub
597 $ hg add .hgsub
598 $ hg ci -m addsub
599 $ hg up null
600 0 files updated, 0 files merged, 2 files removed, 0 files unresolved
601 $ hg up
602 A *subdir/a (glob)
603 Checked out revision 15.
604 2 files updated, 0 files merged, 0 files removed, 0 files unresolved
605 $ cd ..
General Comments 0
You need to be logged in to leave comments. Login now