Comments
Patch
@@ -1129,6 +1129,23 @@
return exitcode;
}
+/* The high level push command for hglib API. */
+int hg_push(hg_handle *handle, int(*callback)(const char *msg, size_t len),
+ char *argument[])
+{
+ int exitcode;
+ char **command = cmdbuilder("push", 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)
@@ -1704,6 +1704,38 @@
char *argument[]);
/**
+ * \brief hg_push command for hglib API.
+ *
+ * Push changesets from this repository to the specified destination.
+ *
+ * This operation is symmetrical to pull: it is identical to a pull in the
+ * destination repository from the current one.
+ *
+ * Options/Argument list option:
+ *
+ * -f, --force force push
+ * -r, --rev a changeset intended to be included in the destination
+ * -B, --bookmark bookmark to push
+ * -b, --branch a specific branch you would like to push
+ * --new-branch allow pushing a new branch
+ * -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_push(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()