[libgit2-glib/wip/development: 1/14] AutomergeMode was renamed to FileFavor



commit d0a9e8bd2ae5f4317a9d9b8be009fec1a91f5fa0
Author: Ignacio Casal Quinteiro <icq gnome org>
Date:   Sat Apr 26 15:54:48 2014 +0200

    AutomergeMode was renamed to FileFavor

 libgit2-glib/ggit-merge-tree-options.c |   14 +++++++-------
 libgit2-glib/ggit-merge-tree-options.h |    4 ++--
 libgit2-glib/ggit-types.c              |    8 ++++----
 libgit2-glib/ggit-types.h              |   27 ++++++++++++++++++---------
 4 files changed, 31 insertions(+), 22 deletions(-)
---
diff --git a/libgit2-glib/ggit-merge-tree-options.c b/libgit2-glib/ggit-merge-tree-options.c
index 2afbaaf..7c7a686 100644
--- a/libgit2-glib/ggit-merge-tree-options.c
+++ b/libgit2-glib/ggit-merge-tree-options.c
@@ -23,13 +23,13 @@
 
 struct _GgitMergeTreeOptions
 {
-       git_merge_tree_opts merge_options;
+       git_merge_options merge_options;
 };
 
 G_DEFINE_BOXED_TYPE (GgitMergeTreeOptions, ggit_merge_tree_options,
                      ggit_merge_tree_options_copy, ggit_merge_tree_options_free)
 
-const git_merge_tree_opts *
+const git_merge_options *
 _ggit_merge_tree_options_get_merge_tree_options (GgitMergeTreeOptions *merge_options)
 {
        /* NULL is common for merge_tree_options as it specifies to use the default
@@ -40,7 +40,7 @@ _ggit_merge_tree_options_get_merge_tree_options (GgitMergeTreeOptions *merge_opt
                return NULL;
        }
 
-       return (const git_merge_tree_opts *)&merge_options->merge_options;
+       return (const git_merge_options *)&merge_options->merge_options;
 }
 
 /**
@@ -86,7 +86,7 @@ ggit_merge_tree_options_free (GgitMergeTreeOptions *merge_options)
  * @target_limit: maximum similarity sources to examine
  *                (overrides the `merge_tree.renameLimit` config) (default 200).
  * @metric: (allow-none): a #GgitDiffSimilarityMetric or %NULL to use internal metric.
- * @automerge_mode: mode for automerging.
+ * @file_favor: a #GgitMergeFileFavor.
  *
  * Creates a new #GgitMergeTreeOptions.
  *
@@ -97,10 +97,10 @@ ggit_merge_tree_options_new (GgitMergeTreeFlags        flags,
                              guint                     rename_threshold,
                              guint                     target_limit,
                              GgitDiffSimilarityMetric *metric,
-                             GgitMergeAutomergeMode    automerge_mode)
+                             GgitMergeFileFavor        file_favor)
 {
        GgitMergeTreeOptions *merge_options;
-       git_merge_tree_opts gmerge_options = GIT_MERGE_TREE_OPTS_INIT;
+       git_merge_options gmerge_options = GIT_MERGE_OPTIONS_INIT;
 
        merge_options = g_slice_new (GgitMergeTreeOptions);
 
@@ -108,7 +108,7 @@ ggit_merge_tree_options_new (GgitMergeTreeFlags        flags,
        gmerge_options.rename_threshold = rename_threshold;
        gmerge_options.target_limit = target_limit;
        gmerge_options.metric = _ggit_diff_similarity_metric_get_similarity_metric (metric);
-       gmerge_options.automerge_flags = (git_merge_automerge_flags)automerge_mode;
+       gmerge_options.file_favor = (git_merge_file_favor_t)file_favor;
 
        merge_options->merge_options = gmerge_options;
 
diff --git a/libgit2-glib/ggit-merge-tree-options.h b/libgit2-glib/ggit-merge-tree-options.h
index 40ce9d0..c93856c 100644
--- a/libgit2-glib/ggit-merge-tree-options.h
+++ b/libgit2-glib/ggit-merge-tree-options.h
@@ -34,7 +34,7 @@ G_BEGIN_DECLS
 
 GType                  ggit_merge_tree_options_get_type                (void) G_GNUC_CONST;
 
-const git_merge_tree_opts *
+const git_merge_options *
                       _ggit_merge_tree_options_get_merge_tree_options  (GgitMergeTreeOptions   
*merge_options);
 
 GgitMergeTreeOptions  *ggit_merge_tree_options_copy                    (GgitMergeTreeOptions   
*merge_options);
@@ -44,7 +44,7 @@ GgitMergeTreeOptions  *ggit_merge_tree_options_new                     (GgitMerg
                                                                         guint                     
rename_threshold,
                                                                         guint                     
target_limit,
                                                                         GgitDiffSimilarityMetric *metric,
-                                                                        GgitMergeAutomergeMode    
automerge_mode);
+                                                                        GgitMergeFileFavor       file_favor);
 
 G_END_DECLS
 
diff --git a/libgit2-glib/ggit-types.c b/libgit2-glib/ggit-types.c
index d63b476..873b3bc 100644
--- a/libgit2-glib/ggit-types.c
+++ b/libgit2-glib/ggit-types.c
@@ -112,10 +112,10 @@ ASSERT_ENUM (GGIT_FILE_MODE_BLOB_EXECUTABLE, GIT_FILEMODE_BLOB_EXECUTABLE);
 ASSERT_ENUM (GGIT_FILE_MODE_LINK, GIT_FILEMODE_LINK);
 ASSERT_ENUM (GGIT_FILE_MODE_COMMIT, GIT_FILEMODE_COMMIT);
 
-ASSERT_ENUM (GGIT_MERGE_AUTOMERGE_MODE_NORMAL, GIT_MERGE_AUTOMERGE_NORMAL);
-ASSERT_ENUM (GGIT_MERGE_AUTOMERGE_MODE_NONE, GIT_MERGE_AUTOMERGE_NONE);
-ASSERT_ENUM (GGIT_MERGE_AUTOMERGE_MODE_FAVOR_OURS, GIT_MERGE_AUTOMERGE_FAVOR_OURS);
-ASSERT_ENUM (GGIT_MERGE_AUTOMERGE_MODE_FAVOR_THEIRS, GIT_MERGE_AUTOMERGE_FAVOR_THEIRS);
+ASSERT_ENUM (GGIT_MERGE_FILE_FAVOR_NORMAL, GIT_MERGE_FILE_FAVOR_NORMAL);
+ASSERT_ENUM (GGIT_MERGE_FILE_FAVOR_OURS, GIT_MERGE_FILE_FAVOR_OURS);
+ASSERT_ENUM (GGIT_MERGE_FILE_FAVOR_THEIRS, GIT_MERGE_FILE_FAVOR_THEIRS);
+ASSERT_ENUM (GGIT_MERGE_FILE_FAVOR_UNION, GIT_MERGE_FILE_FAVOR_UNION);
 
 ASSERT_ENUM (GGIT_MERGE_TREE_FIND_RENAMES, GIT_MERGE_TREE_FIND_RENAMES);
 
diff --git a/libgit2-glib/ggit-types.h b/libgit2-glib/ggit-types.h
index a3ea0af..019f5e4 100644
--- a/libgit2-glib/ggit-types.h
+++ b/libgit2-glib/ggit-types.h
@@ -634,17 +634,26 @@ typedef enum {
 /* NOTE: keep in sync with git2/merge.h */
 /**
  * GgitMergeAutomergeMode:
- * @GGIT_MERGE_AUTOMERGE_MODE_NORMAL:
- * @GGIT_MERGE_AUTOMERGE_MODE_NONE:
- * @GGIT_MERGE_AUTOMERGE_MODE_FAVOR_OURS:
- * @GGIT_MERGE_AUTOMERGE_MODE_FAVOR_THEIRS:
+ * @GGIT_MERGE_FILE_FAVOR_NORMAL: When a region of a file is changed in both branches,
+ * a conflict will be recorded in the index so that `git_checkout` can produce
+ * a merge file with conflict markers in the working directory. This is the default.
+ * @GGIT_MERGE_FILE_FAVOR_OURS: When a region of a file is changed in both branches, the file
+ * created in the index will contain the "ours" side of any conflicting
+ * region. The index will not record a conflict.
+ * @GGIT_MERGE_FILE_FAVOR_THEIRS: When a region of a file is changed in both branches, the file
+ * created in the index will contain the "theirs" side of any conflicting
+ * region. The index will not record a conflict.
+ * @GGIT_MERGE_FILE_FAVOR_UNION: When a region of a file is changed in both branches, the file
+ * created in the index will contain each unique line from each side,
+ * which has the result of combining both files.  The index will not
+ * record a conflict.
  */
 typedef enum {
-       GGIT_MERGE_AUTOMERGE_MODE_NORMAL       = 0,
-       GGIT_MERGE_AUTOMERGE_MODE_NONE         = 1,
-       GGIT_MERGE_AUTOMERGE_MODE_FAVOR_OURS   = 2,
-       GGIT_MERGE_AUTOMERGE_MODE_FAVOR_THEIRS = 3
-} GgitMergeAutomergeMode;
+       GGIT_MERGE_FILE_FAVOR_NORMAL = 0,
+       GGIT_MERGE_FILE_FAVOR_OURS   = 1,
+       GGIT_MERGE_FILE_FAVOR_THEIRS = 2,
+       GGIT_MERGE_FILE_FAVOR_UNION  = 3
+} GgitMergeFileFavor;
 
 /**
  * GgitMergeTreeFlags:


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]