2

マージの競合を追跡できないように見えることがあります。コミットされていないファイルの1つを破棄して、リモートコピーで更新できるコマンドが必要です。

hg revert myfileに続いて、hg pull、hg commitを試しましたが、それでもマージまたはコミットできません。

未解決の競合を最初に修正するように指示され続けます。

4

1 に答える 1

3

を使用して、競合が解決したことをMercurialに通知する必要がある場合がありますhg resolve。マニュアルページから:

hg resolve [OPTION]... [FILE]...

redo merges or set/view the merge status of files

  Merges with unresolved conflicts are often the result of non-interactive
  merging using the "internal:merge" configuration setting, or a command-
  line merge tool like "diff3". The resolve command is used to manage the
  files involved in a merge, after "hg merge" has been run, and before "hg
  commit" is run (i.e. the working directory must have two parents). See "hg
  help merge-tools" for information on configuring merge tools.

  The resolve command can be used in the following ways:

  - "hg resolve [--tool TOOL] FILE...": attempt to re-merge the specified
    files, discarding any previous merge attempts. Re-merging is not
    performed for files already marked as resolved. Use "--all/-a" to select
    all unresolved files. "--tool" can be used to specify the merge tool
    used for the given files. It overrides the HGMERGE environment variable
    and your configuration files.  Previous file contents are saved with a
    ".orig" suffix.
  - "hg resolve -m [FILE]": mark a file as having been resolved (e.g. after
  having manually fixed-up the files). The default is to mark all
  unresolved files.
  - "hg resolve -u [FILE]...": mark a file as unresolved. The default is to
    mark all resolved files.
  - "hg resolve -l": list files which had or still have conflicts. In the
    printed list, "U" = unresolved and "R" = resolved.

  Note that Mercurial will not let you commit files with unresolved merge
  conflicts. You must use "hg resolve -m ..." before you can commit after a
  conflicting merge.

サーバーからファイルのバージョンを取得する方法は次のとおりです。「hgpull」すると、サーバーからのすべての変更がリポジトリのコピーに反映されます。次を使用して、任意のリビジョンのファイルの内容を取得できます。

hg cat -r <rev> <file>

これを使用してローカルファイルを上書きし、コミットします。

于 2012-07-24T14:51:00.677 に答える