[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Svnadmin dump with include can not dump the subdir into add when it's parent path was a branch

From: Daniel Shahaf <d.s_at_daniel.shahaf.name>
Date: Sat, 21 Mar 2020 17:35:17 +0000

[moving to dev@; please remove users@ from replies]

钱海远(Nathan) wrote on Sat, 21 Mar 2020 06:12 +0000:
> I found the there is a BUG in subversion 1.10.6.
>
> Svnadmin dump with include can not dump the subdir into add when it's parent path was a branch:
> 1. 1、/A was copy from/XX , revision was 50, it the first revision of /A; 2. 2、There is a subdir named /A/subdir, and several files and dir under /A/subdir; 3. 3、Try to run “svnadmin dump /data/repos_root --include /A/subdir >a” . The expected dump file will include /A/subdir(revision 50) into add. But in fact there was nothing.
> 4. 4、I was try to fix this bug in the svnadmin.c , a function named ary_prefix_match. If the change list is the parent dir for include path, it return true. Then the dump file will include /A/subdir and it's subdir or subfile into add , but regrettably, the dump file will also include /A into add.

钱海远(Nathan) wrote on Sat, 21 Mar 2020 06:12 +0000:
> --- C:/Users/QIANHA~1/AppData/Local/Temp/svnadmin.c-rev30397.svn001.tmp.c ____ ____ 25 11:51:32 2020
> +++ C:/Users/QIANHA~1/AppData/Local/Temp/svnadmin.c-rev30398.svn000.tmp.c ____ ____ 21 12:58:58 2020
> @@ -1297,3 +1297,3 @@ ary_prefix_match(const apr_array_header_t *pfxlist
> - if (path_len < pfx_len)
> - continue;
> - if (strncmp(path, pfx, pfx_len) == 0
> + /*if (path_len < pfx_len)
> + continue;*/
> + if ((strncmp(path, pfx, pfx_len) == 0
> @@ -1300,0 +1301,3 @@ ary_prefix_match(const apr_array_header_t *pfxlist
> + || (strncmp(pfx,path, path_len) == 0
> + && (path_len == 1 || path[path_len] == '\0' || path[path_len] == '/'))
> + )

Thanks for the patch. I don't see any obvious problems with this
approach. However, the patch as it stands causes a regression:

[[[
W: /home/daniel/src/svn/t1/./subversion/libsvn_repos/load.c:667,
W: /home/daniel/src/svn/t1/./subversion/libsvn_repos/load-fs-vtable.c:718,
W: /home/daniel/src/svn/t1/./subversion/libsvn_repos/load-fs-vtable.c:591,
W: /home/daniel/src/svn/t1/./subversion/libsvn_fs/fs-loader.c:1482,
W: /home/daniel/src/svn/t1/./subversion/libsvn_fs_fs/tree.c:2524,
W: /home/daniel/src/svn/t1/./subversion/libsvn_fs_fs/tree.c:1145: (apr_err=SVN_ERR_FS_NOT_FOUND)
W: svnadmin: E160013: File not found: transaction '0-0', path '/A/B/F'
W: CWD: /tmp/svn/subversion/tests/cmdline
W: EXCEPTION: Failure: Command failed: "/tmp/svn/subversion/svnadmin/svnadmin load --quiet svn-test-work/repositories/svnadmin_tests-60-1"; exit code 1
Traceback (most recent call last):
  File "/home/daniel/src/svn/t1/subversion/tests/cmdline/svntest/main.py", line 1931, in run
    rc = self.pred.run(sandbox)
  File "/home/daniel/src/svn/t1/subversion/tests/cmdline/svntest/testcase.py", line 178, in run
    result = self.func(sandbox)
  File "/home/daniel/src/svn/t1/subversion/tests/cmdline/svnadmin_tests.py", line 3510, in dump_exclude
    load_and_verify_dumpstream(sbox2, None, [], None, False, dump)
  File "/home/daniel/src/svn/t1/subversion/tests/cmdline/svnadmin_tests.py", line 304, in load_and_verify_dumpstream
    'load', '--quiet', sbox.repo_dir, *varargs)
  File "/home/daniel/src/svn/t1/subversion/tests/cmdline/svntest/main.py", line 666, in run_command_stdin
    '"; exit code ' + str(exit_code))
svntest.Failure: Command failed: "/tmp/svn/subversion/svnadmin/svnadmin load --quiet svn-test-work/repositories/svnadmin_tests-60-1"; exit code 1
FAIL: svnadmin_tests.py 60: svnadmin dump with excluded paths
]]]

So, I guess the new condition should be applied to --include's but not
to --exclude's?

Cheers,

Daniel
Received on 2020-03-21 18:35:27 CET

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.