1790
1790
"Could not get created rev of "
1791
1791
"resource", r->pool);
1793
if (comb->priv.version_name < created_rev)
1795
serr = svn_error_createf(SVN_ERR_RA_OUT_OF_DATE, NULL,
1796
"Item '%s' is out of date",
1797
comb->priv.repos_path);
1798
return dav_svn__convert_err(serr, HTTP_CONFLICT,
1799
"Attempting to modify out-of-date resource.",
1793
if (SVN_IS_VALID_REVNUM(created_rev))
1795
if (comb->priv.version_name < created_rev)
1797
serr = svn_error_createf(SVN_ERR_RA_OUT_OF_DATE, NULL,
1798
comb->res.collection
1799
? "Directory '%s' is out of date"
1801
? "File '%s' is out of date"
1802
: "'%s' is out of date"),
1803
comb->priv.repos_path);
1804
return dav_svn__convert_err(serr, HTTP_CONFLICT,
1805
"Attempting to modify out-of-date resource.",
1809
else if (SVN_IS_VALID_REVNUM(comb->priv.version_name)
1810
&& comb->res.collection)
1812
/* Issue #4480: With HTTPv2 we can receive the first change for a
1813
directory after it has been made mutable, because one of its
1814
descendants was changed before changing the directory.
1816
We have to check if whatever the node is in HEAD is equivalent
1817
to what it was in the provided BASE revision.
1819
If the node was copied, we would process it before its decendants
1820
and we already performed quite a few checks when making it mutable
1821
via its descendant, so what we should really check here is if the
1822
properties changed since the BASE version.
1824
### I think svn_fs_node_relation() checks for more changes than we
1825
should check for here. Needs further review. But it looks like\
1826
this check matches the checks in the libsvn_fs commit editor.
1828
For now I would say reporting out of date in a few too many
1829
cases is safer than not reporting out of date when we should.
1831
svn_revnum_t txn_base_rev;
1832
svn_fs_root_t *txn_base_root;
1833
svn_fs_root_t *rev_root;
1834
const svn_fs_id_t *txn_base_id;
1835
const svn_fs_id_t *rev_id;
1837
txn_base_rev = svn_fs_txn_base_revision(comb->res.info->root.txn);
1839
if (comb->priv.version_name == txn_base_rev)
1840
return NULL; /* Easy out: Nothing changed */
1842
serr = svn_fs_revision_root(&txn_base_root, comb->res.info->repos->fs,
1843
txn_base_rev, r->pool);
1846
serr = svn_fs_node_id(&txn_base_id, txn_base_root,
1847
comb->priv.repos_path, r->pool);
1851
return dav_svn__convert_err(serr, HTTP_INTERNAL_SERVER_ERROR,
1852
"Could not open youngest revision root "
1853
"for verification against the base "
1854
"revision", r->pool);
1857
serr = svn_fs_revision_root(&rev_root, comb->res.info->repos->fs,
1858
comb->priv.version_name, r->pool);
1861
serr = svn_fs_node_id(&rev_id, rev_root,
1862
comb->priv.repos_path, r->pool);
1866
return dav_svn__convert_err(serr, HTTP_INTERNAL_SERVER_ERROR,
1867
"Could not open the base revision"
1868
"for verification against the youngest "
1869
"revision", r->pool);
1872
svn_fs_close_root(rev_root);
1873
svn_fs_close_root(txn_base_root);
1875
if (0 != svn_fs_compare_ids(txn_base_id, rev_id))
1877
serr = svn_error_createf(SVN_ERR_RA_OUT_OF_DATE, NULL,
1878
"Directory '%s' is out of date",
1879
comb->priv.repos_path);
1880
return dav_svn__convert_err(serr, HTTP_CONFLICT,
1881
"Attempting to modify out-of-date resource.",