--- a/hgext/convert/hg.py Mon Aug 06 21:49:26 2007 +0200
+++ b/hgext/convert/hg.py Mon Aug 06 14:17:05 2007 -0700
@@ -134,7 +134,10 @@
return self.lastctx
def getheads(self):
- return [hex(node) for node in self.repo.heads()]
+ if self.rev:
+ return [hex(self.repo.changectx(self.rev).node())]
+ else:
+ return [hex(node) for node in self.repo.heads()]
def getfile(self, name, rev):
try:
--- a/hgext/convert/subversion.py Mon Aug 06 21:49:26 2007 +0200
+++ b/hgext/convert/subversion.py Mon Aug 06 14:17:05 2007 -0700
@@ -102,7 +102,7 @@
try:
latest = int(rev)
except ValueError:
- raise util.Abort('svn: revision %s is not an integer' % rev)
+ raise NoRepo('svn: revision %s is not an integer' % rev)
try:
# Support file://path@rev syntax. Useful e.g. to convert
# deleted branches.
--- a/hgext/record.py Mon Aug 06 21:49:26 2007 +0200
+++ b/hgext/record.py Mon Aug 06 14:17:05 2007 -0700
@@ -327,8 +327,8 @@
try:
os.mkdir(backupdir)
except OSError, err:
- if err.errno == errno.EEXIST:
- pass
+ if err.errno != errno.EEXIST:
+ raise
try:
for f in newfiles:
if f not in modified:
@@ -363,7 +363,7 @@
try:
for realname, tmpname in backups.iteritems():
ui.debug('restoring %r to %r\n' % (tmpname, realname))
- util.copyfile(tmpname, realname)
+ util.copyfile(tmpname, repo.wjoin(realname))
os.unlink(tmpname)
os.rmdir(backupdir)
except OSError:
--- a/tests/test-record Mon Aug 06 21:49:26 2007 +0200
+++ b/tests/test-record Mon Aug 06 14:17:05 2007 -0700
@@ -202,3 +202,15 @@
y
EOF
echo; hg tip -p
+
+mkdir subdir
+cd subdir
+echo a > a
+hg ci -d '16 0' -Amsubdir
+
+echo a >> a
+hg record -d '16 0' -m subdir-change a <<EOF
+y
+y
+EOF
+echo; hg tip -p
--- a/tests/test-record.out Mon Aug 06 21:49:26 2007 +0200
+++ b/tests/test-record.out Mon Aug 06 14:17:05 2007 -0700
@@ -381,3 +381,23 @@
+10
+11
+adding subdir/a
+diff --git a/subdir/a b/subdir/a
+1 hunks, 1 lines changed
+record changes to 'subdir/a'? [y]es [n]o @@ -1,1 +1,2 @@ a
+ a
++a
+record this change to 'subdir/a'? [y]es [n]o
+changeset: 18:33ff5c4fb017
+tag: tip
+user: test
+date: Thu Jan 01 00:00:16 1970 +0000
+summary: subdir-change
+
+diff -r aecf2b2ea83c -r 33ff5c4fb017 subdir/a
+--- a/subdir/a Thu Jan 01 00:00:16 1970 +0000
++++ b/subdir/a Thu Jan 01 00:00:16 1970 +0000
+@@ -1,1 +1,2 @@ a
+ a
++a
+