Comments
Patch
@@ -1112,6 +1112,23 @@
return lbuf;
}
+/* The high level pull command for hglib API. */
+int hg_pull(hg_handle *handle, int(*callback)(const char *msg, size_t len),
+ char *argument[])
+{
+ int exitcode;
+ char **command = cmdbuilder("pull", argument, NULL);
+
+ if(hg_rawcommand(handle, command) < 0){
+ return -1;
+ }
+ free(command);
+
+ exitcode = hg_runcommand(handle, callback, NULL);
+
+ return exitcode;
+}
+
/* 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)
@@ -1670,6 +1670,40 @@
(const char *msg, size_t len), char *argument[]);
/**
+ * \brief hg_pull command for hglib API.
+ *
+ * Pull changes from a remote repository to a local one.
+ *
+ * This finds all changes from the repository at the specified path or URL and
+ * adds them to a local repository (the current one unless -R is specified). By
+ * default, this does not update the copy of the project in the working
+ * directory.
+ *
+ * Options/Argument list option:
+ *
+ * -u, --update update to new branch head if changesets were pulled
+ * -f, --force run even when remote repository is unrelated
+ * -r, --rev a remote changeset intended to be added
+ * -B, --bookmark bookmark to pull
+ * -b, --branch a specific branch you would like to pull
+ * -e, --ssh specify ssh command to use
+ * --remotecmd specify hg command to run on the remote side
+ * --insecure do not verify server certificate (ignoring
+ * web.cacerts config)
+ *
+ * \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 exitcode To indicate the end of pull_command.
+ *
+ * errno can be:
+ * - hg_rawcommand errors
+ * */
+int hg_pull(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()