Index: subversion/libsvn_wc/status.c
===================================================================
--- subversion/libsvn_wc/status.c (revision 16376)
+++ subversion/libsvn_wc/status.c (working copy)
@@ -134,11 +134,13 @@
/* The pool in which this baton itself is allocated. */
apr_pool_t *pool;
+ /* The URI to this item in the repository. */
+ const char *url;
+
/* Out of date info corresponding to ood_* fields in svn_wc_status2_t. */
svn_revnum_t ood_last_cmt_rev;
apr_time_t ood_last_cmt_date;
svn_node_kind_t ood_kind;
- const char *ood_url;
const char *ood_last_cmt_author;
};
@@ -174,11 +176,13 @@
the code that syncs up the adm dir and working copy. */
svn_boolean_t prop_changed;
+ /* The URI to this item in the repository. */
+ const char *url;
+
/* Out of date info corresponding to ood_* fields in svn_wc_status2_t. */
svn_revnum_t ood_last_cmt_rev;
apr_time_t ood_last_cmt_date;
svn_node_kind_t ood_kind;
- const char *ood_url;
const char *ood_last_cmt_author;
};
@@ -296,10 +300,10 @@
}
stat->repos_lock = repos_lock;
+ stat->url = NULL;
stat->ood_last_cmt_rev = SVN_INVALID_REVNUM;
stat->ood_last_cmt_date = 0;
stat->ood_kind = svn_wc_status_none;
- stat->ood_url = NULL;
stat->ood_last_cmt_author = NULL;
*status = stat;
@@ -485,10 +489,10 @@
stat->switched = switched_p;
stat->copied = entry->copied;
stat->repos_lock = repos_lock;
+ stat->url = (entry->url ? entry->url : NULL);
stat->ood_last_cmt_rev = SVN_INVALID_REVNUM;
stat->ood_last_cmt_date = 0;
stat->ood_kind = svn_wc_status_none;
- stat->ood_url = NULL;
stat->ood_last_cmt_author = NULL;
*status = stat;
@@ -1045,8 +1049,9 @@
if (is_dir_baton)
{
struct dir_baton *b = baton;
+ if (b->url)
+ statstruct->url = b->url;
statstruct->ood_kind = b->ood_kind;
- statstruct->ood_url = b->ood_url;
/* The last committed rev, date, and author for deleted items
isn't available. */
if (statstruct->repos_text_status != svn_wc_status_deleted)
@@ -1059,16 +1064,41 @@
else
{
struct file_baton *b = baton;
+ if (b->url)
+ statstruct->url = b->url;
statstruct->ood_last_cmt_rev = b->ood_last_cmt_rev;
statstruct->ood_last_cmt_date = b->ood_last_cmt_date;
statstruct->ood_kind = b->ood_kind;
- statstruct->ood_url = b->ood_url;
statstruct->ood_last_cmt_author = b->ood_last_cmt_author;
}
return SVN_NO_ERROR;
}
+/* Returns the URL for DB, or NULL: */
+static const char *
+find_dir_url (const struct dir_baton *db, apr_pool_t *pool)
+{
+ /* If we have no name, we're the root, return the anchor URL. */
+ if (! db->name)
+ return db->edit_baton->anchor_status->entry->url;
+ else
+ {
+ const char *url;
+ struct dir_baton *pb = db->parent_baton;
+ svn_wc_status2_t *status = apr_hash_get (pb->statii, db->name,
+ APR_HASH_KEY_STRING);
+ if (status && status->entry)
+ return status->entry->url;
+ url = find_dir_url (pb, pool);
+ if (url)
+ return svn_path_url_add_component (url, db->name, pool);
+ else
+ return NULL;
+ }
+}
+
+
/* Create a new dir_baton for subdir PATH. */
static svn_error_t *
@@ -1101,10 +1131,10 @@
d->parent_baton = parent_baton;
d->pool = pool;
d->statii = apr_hash_make (pool);
+ d->url = apr_pstrdup (pool, find_dir_url (d, pool));
d->ood_last_cmt_rev = SVN_INVALID_REVNUM;
d->ood_last_cmt_date = 0;
- d->ood_kind = svn_wc_status_none;
- d->ood_url = NULL;
+ d->ood_kind = svn_node_dir;
d->ood_last_cmt_author = NULL;
/* Get the status for this path's children. Of course, we only want
@@ -1165,38 +1195,16 @@
f->pool = pool;
f->dir_baton = pb;
f->edit_baton = eb;
+ f->url = svn_path_url_add_component (find_dir_url (pb, pool),
+ svn_path_basename (full_path, pool),
+ pool);
f->ood_last_cmt_rev = SVN_INVALID_REVNUM;
f->ood_last_cmt_date = 0;
- f->ood_kind = svn_wc_status_none;
- f->ood_url = NULL;
+ f->ood_kind = svn_node_file;
f->ood_last_cmt_author = NULL;
return f;
}
-/* Returns the URL for DB, or NULL: */
-static const char *
-find_dir_url (const struct dir_baton *db, apr_pool_t *pool)
-{
- /* If we have no name, we're the root, return the anchor URL. */
- if (! db->name)
- return db->edit_baton->anchor_status->entry->url;
- else
- {
- const char *url;
- struct dir_baton *pb = db->parent_baton;
- svn_wc_status2_t *status = apr_hash_get (pb->statii, db->name,
- APR_HASH_KEY_STRING);
- if (status && status->entry)
- return status->entry->url;
-
- url = find_dir_url (pb, pool);
- if (url)
- return svn_path_url_add_component (url, db->name, pool);
- else
- return NULL;
- }
-}
-
/* Return a boolean answer to the question "Is STATUS something that
should be reported?". EB is the edit baton. */
static svn_boolean_t
@@ -1498,10 +1506,7 @@
if (svn_wc_is_normal_prop (name))
db->prop_changed = TRUE;
- /* Store out of date info. */
- db->ood_kind = svn_node_dir;
- if (!db->ood_url)
- db->ood_url = apr_pstrdup (db->pool, find_dir_url (db, pool));
+ /* Note any changes to the repository. */
if (strcmp (name, SVN_PROP_ENTRY_COMMITTED_REV) == 0)
db->ood_last_cmt_rev = SVN_STR_TO_REV (value->data);
else if (strcmp (name, SVN_PROP_ENTRY_LAST_AUTHOR) == 0)
@@ -1691,18 +1696,7 @@
if (svn_wc_is_normal_prop (name))
fb->prop_changed = TRUE;
- /* Store out of date info. */
- fb->ood_kind = svn_node_file;
- if (!fb->ood_url)
- {
- const char *url =
- svn_path_url_add_component (find_dir_url (fb->dir_baton, pool),
- svn_path_basename (fb->path, pool),
- pool);
-
- /* Copy into file_baton with a safe pool. */
- fb->ood_url = apr_pstrdup (fb->dir_baton->pool, url);
- }
+ /* Note any changes to the repository. */
if (strcmp (name, SVN_PROP_ENTRY_COMMITTED_REV) == 0)
fb->ood_last_cmt_rev = SVN_STR_TO_REV (value->data);
else if (strcmp (name, SVN_PROP_ENTRY_LAST_AUTHOR) == 0)
Index: subversion/bindings/java/javahl/native/SVNClient.cpp
===================================================================
--- subversion/bindings/java/javahl/native/SVNClient.cpp (revision 16436)
+++ subversion/bindings/java/javahl/native/SVNClient.cpp (working copy)
@@ -1806,7 +1806,8 @@
"(Ljava/lang/String;Ljava/lang/String;IJJJLjava/lang/String;IIIIZZ"
"Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;"
"Ljava/lang/String;JZLjava/lang/String;Ljava/lang/String;"
- "Ljava/lang/String;JLorg/tigris/subversion/javahl/Lock;)V");
+ "Ljava/lang/String;JLorg/tigris/subversion/javahl/Lock;"
+ "JJILjava/lang/String;)V");
if(JNIUtil::isJavaExceptionThrown())
{
return NULL;
@@ -1843,6 +1844,11 @@
jstring jLockOwner = NULL;
jlong jLockCreationDate = 0;
jobject jLock = NULL;
+ jlong jOODLastCmtRevision =
+ org_tigris_subversion_javahl_Revision_SVN_INVALID_REVNUM;
+ jlong jOODLastCmtDate = 0;
+ jint jOODKind = org_tigris_subversion_javahl_NodeKind_none;
+ jstring jOODLastCmtAuthor = NULL;
if(status != NULL)
{
@@ -1858,10 +1864,19 @@
{
return NULL;
}
+ jOODLastCmtRevision = status->ood_last_cmt_rev;
+ jOODLastCmtDate = status->ood_last_cmt_date;
+ jOODKind = EnumMapper::mapNodeKind(status->ood_kind);
+ jOODLastCmtAuthor = JNIUtil::makeJString(status->ood_last_cmt_author);
+ if(JNIUtil::isJavaExceptionThrown())
+ {
+ return NULL;
+ }
+
svn_wc_entry_t * entry = status->entry;
if (entry != NULL)
{
- jUrl = JNIUtil::makeJString(entry->url);
+ jUrl = JNIUtil::makeJString(status->url);
if(JNIUtil::isJavaExceptionThrown())
{
return NULL;
@@ -1921,7 +1936,8 @@
jTextType, jPropType, jRepositoryTextType, jRepositoryPropType,
jIsLocked, jIsCopied, jConflictOld, jConflictNew, jConflictWorking,
jURLCopiedFrom, jRevisionCopiedFrom, jIsSwitched, jLockToken,
- jLockOwner, jLockComment, jLockCreationDate, jLock);
+ jLockOwner, jLockComment, jLockCreationDate, jLock,
+ jOODLastCmtRevision, jOODLastCmtDate, jOODKind, jOODLastCmtAuthor);
if(JNIUtil::isJavaExceptionThrown())
{
return NULL;
@@ -1986,6 +2002,11 @@
{
return NULL;
}
+ env->DeleteLocalRef(jOODLastCmtAuthor);
+ if(JNIUtil::isJavaExceptionThrown())
+ {
+ return NULL;
+ }
return ret;
}
Index: subversion/bindings/java/javahl/src/org/tigris/subversion/javahl/Status.java
===================================================================
--- subversion/bindings/java/javahl/src/org/tigris/subversion/javahl/Status.java (revision 16376)
+++ subversion/bindings/java/javahl/src/org/tigris/subversion/javahl/Status.java (working copy)
@@ -136,6 +136,29 @@
* the lock in the repository
*/
private Lock reposLock;
+ /**
+ * @since 1.3
+ * Set to the youngest committed revision, or {@link
+ * Revision#SVN_INVALID_REVNUM} if not out of date.
+ */
+ private long reposLastCmtRevision = Revision.SVN_INVALID_REVNUM;
+ /**
+ * @since 1.3
+ * Set to the most recent commit date, or 0 if not out of date.
+ */
+ private long reposLastCmtDate = 0;
+ /**
+ * @since 1.3
+ * Set to the node kind of the youngest commit, or {@link
+ * NodeKind#none} if not out of date.
+ */
+ private int reposKind = NodeKind.none;
+ /**
+ * @since 1.3
+ * Set to the user name of the youngest commit, or
+ * null if not out of date.
+ */
+ private String reposLastCmtAuthor;
/**
* this constructor should only called from JNI code
@@ -171,6 +194,12 @@
* @param lockCreationDate the date, the lock was created if any
* @param reposLock the lock as stored in the repository if
* any
+ * @param reposLastCmtRevision the youngest revision, if out of date
+ * @param reposLastCmtDate the last commit date, if out of date
+ * @param reposKind the kind of the youngest revision, if
+ * out of date
+ * @param reposLastCmtAuthor the author of the last commit, if out of
+ * date
*/
public Status(String path, String url, int nodeKind, long revision,
long lastChangedRevision, long lastChangedDate,
@@ -180,7 +209,9 @@
String conflictNew, String conflictWorking,
String urlCopiedFrom, long revisionCopiedFrom,
boolean switched, String lockToken, String lockOwner,
- String lockComment, long lockCreationDate, Lock reposLock)
+ String lockComment, long lockCreationDate, Lock reposLock,
+ long reposLastCmtRevision, long reposLastCmtDate,
+ int reposKind, String reposLastCmtAuthor)
{
this.path = path;
this.url = url;
@@ -206,6 +237,10 @@
this.lockComment = lockComment;
this.lockCreationDate = lockCreationDate;
this.reposLock = reposLock;
+ this.reposLastCmtRevision = reposLastCmtRevision;
+ this.reposLastCmtDate = reposLastCmtDate;
+ this.reposKind = reposKind;
+ this.reposLastCmtAuthor = reposLastCmtAuthor;
}
/**
@@ -358,8 +393,13 @@
}
/**
- * Returns the repository url if any
- * @return url in repository or null if not known
+ * Returns the URI to where the item might exist in the
+ * repository. We say "might" because the item might exist in
+ * your working copy, but have been deleted from the repository.
+ * Or it might exist in the repository, but your working copy
+ * might not yet contain it (because the WC is not up to date).
+ * @return URI in repository, or null if the item
+ * exists in neither the repository nor the WC.
*/
public String getUrl()
{
@@ -546,7 +586,48 @@
{
return reposLock;
}
+
/**
+ * @return The last committed revision, or {@link
+ * Revision#SVN_INVALID_REVNUM} if up to date.
+ * @since 1.3
+ */
+ public Revision getReposLastCmtRevision()
+ {
+ return Revision.createNumber(reposLastCmtRevision);
+ }
+
+ /**
+ * @return The last committed date, or null if up to
+ * date.
+ * @since 1.3
+ */
+ public Date getReposLastCmtDate()
+ {
+ return microsecondsToDate(reposLastCmtDate);
+ }
+
+ /**
+ * @return The node kind (e.g. file, directory, etc.), or
+ * null if up to date.
+ * @since 1.3
+ */
+ public int getReposKind()
+ {
+ return reposKind;
+ }
+
+ /**
+ * @return The author of the last commit, or null if
+ * up to date.
+ * @since 1.3
+ */
+ public String getReposLastCmtAuthor()
+ {
+ return reposLastCmtAuthor;
+ }
+
+ /**
* class for kind status of the item or its properties
* the constants are defined in the interface StatusKind for building
* reasons