Comments
Patch
@@ -1011,6 +1011,27 @@
return cbuf;
}
+/* The high level parents command for hglib API. */
+hg_csetstream_buffer *hg_parents(hg_handle *handle, int(*callback)
+ (const char *msg, size_t len), char *argument[])
+{
+ hg_csetstream_buffer *cbuf = malloc(sizeof(hg_csetstream_buffer));
+ cbuf->handle = handle;
+
+ cbuf->command = cmdbuilder("parents", argument, "--template",
+ CHANGESET, NULL);
+
+ if(hg_rawcommand(handle, cbuf->command) < 0){
+ return NULL;
+ }
+
+ cbuf->callback = callback;
+ cbuf->buffer = NULL;
+ cbuf->buf_size = 0;
+
+ return cbuf;
+}
+
/* The yield next step. Getting the next entry. */
int hg_fetch_entry(hg_stream_buffer *stream, int (*detect_byte)(char *buff,
int buf_size, int data_on_pipe), int func_type)
@@ -1543,6 +1543,37 @@
(const char *msg, size_t len), char *argument[]);
/**
+ * \brief hg_parents command for hglib API.
+ *
+ * Print the working directory's parent revisions. If a revision is given via
+ * -r/--rev, the parent of that revision will be printed. If a file argument is
+ * given, the revision in which the file was last changed (before the working
+ * directory revision or the argument to --rev if given) is printed.
+ *
+ * Options/Argument list option:
+ *
+ * -r, --rev show parents of the specified revision
+ * --style display using template map file
+ * --template display with template
+ *
+ * To get parents information use the returned hg_csetstream_buffer structure
+ * with hg_fetch_cset_entry function.
+ *
+ * \param handle The handle of the connection, wherewith I want to communicate
+ * \param callback A function that will handle error data.
+ * A NULL pointer will ignore error data.
+ * \param argument The option list. Will contain all option that you wish.
+ * \retval cset The command return succesful, with a parse data.
+ * \retval NULL The command failed.
+ *
+ * errno can be:
+ * - hg_rawcommand errors
+ *
+ * */
+hg_csetstream_buffer *hg_parents(hg_handle *handle, int(*callback)
+ (const char *msg, size_t len), char *argument[]);
+
+/**
* \brief The yield mechanism that will get the next entry.
*
* This function is used inside of hg_fetch_cset_entry() and hg_fetch_line_entry()