4

p4win GUIクライアントにある「Switch Port Client User」に相当するコマンドラインは何ですか?

すでに 1 つのポートでログインしていますが、別のソース管理ファイル デポにアクセスするために、同じサーバーの別のポートに接続しようとしています。私はそれが使用することを含むと思います:

p4 login

ただし、「ログイン」の「ヘルプ」を読んでも、ポート番号を指定するオプションは表示されません。ユーザー名とクライアント名はどちらも同じままですが、ポート番号を変更するだけで済みます。

4

4 に答える 4

10

P4PORT 構成変数には、Perforce サーバー名と接続先のポート番号が格納されます。この値は環境変数として設定できます。Windows を使用している場合は、「p4 set」を使用してレジストリに設定できます。

p4 set P4PORT=perforce:1669

P4PORT の現在の値を確認するには:

> p4 set P4PORT
P4PORT=perforce:1669
于 2008-11-26T22:07:06.893 に答える
6

任意の P4 コマンドに対して一般的に実行したい場合は、「p4 help usage」で一般的な形式を見つけることができます。

手短に、

p4 -p <your port> login 

あなたが求めたことをします。クライアント仕様、ユーザー名、パスワードなど、コマンドラインからほとんどのものを指定できることに注意してください。

于 2008-12-01T13:21:22.057 に答える
2

構成ファイルを使用して、Perforce が各プロジェクトに接続するポートを設定できます。

最初に、プロジェクトに設定する Perforce 構成変数を含むテキスト ファイルを作成します。たとえば、P4PORT の値を設定するには、ファイルの内容は次のようになります。

P4PORT=hostname:1234

ファイルに.p4configのようなわかりやすい名前を付けて、プロジェクト フォルダーのルートに配置します。プロジェクトごとにこれを行い、必要に応じて変数を変更します。 同じファイル名を使用してください。

次に、 P4CONFIG の値を構成ファイルの名前に設定します。

p4 set P4CONFIG=.p4config

これにより、Perforce は現在のディレクトリまたは任意の親ディレクトリにあるその名前のファイルで構成値を検索するようになるため、プロジェクトを切り替えるたびに構成変数を手動で変更する必要がなくなります。

于 2008-11-26T23:15:00.003 に答える
2

例えば:

p4 set P4PORT=1666

ヘルプから:

C:\> p4 help environment

Environment variables used by Perforce:

    Variable    Defines                          For more information see
    --------    -------                          ------------------------
    P4AUDIT     name of server audit file        p4d -h
    P4CHARSET   client's local character set     p4 help charset
    P4COMMANDCHARSET client's local character set for
                command line operations          p4 help charset
    P4CLIENT    name of client workspace         p4 help client
                                                 p4 help usage
    P4CONFIG    name of configuration file       Command Reference Manual
    P4DIFF      diff program to use on client    p4 help diff
    P4DIFFUNICODE diff program to use on client  p4 help diff
    P4EDITOR    editor invoked by p4 commands    p4 help change, etc
    P4HOST      name of host computer            p4 help client
                                                 p4 help usage
    P4JOURNAL   name of server journal file      p4d -h
    P4LANGUAGE  language for text messages       p4 help usage
    P4LOG       name of server log file          p4d -h
    P4MERGE     merge program to use on client   p4 help resolve
    P4MERGEUNICODE merge program to use on client p4 help resolve
    P4PAGER     pager for 'p4 resolve' output    p4 help resolve
    P4PASSWD    user password passed to server   p4 help passwd
    P4PORT      port client connects to          p4 help info
                or server listens on             p4d -h
    P4ROOT      server root directory            p4d -h
    P4TARGET    target server for proxy          Command Reference Manual
    P4TICKETS   location of tickets file         Command Reference Manual
    P4USER      user name                        p4 help usage
    PWD         current working directory        p4 help usage
    TMP, TEMP   directory for temporary files    Command Reference Manual

See 'p4 help set' for details specific to Windows.  The syntax for
setting an environment variable depends on the OS/shell.  Note that many
shells allow the setting of shell variables separate from environment
variables - Perforce cannot see the shell variable, only the environment
variable.

If you are a typical user then the only variables of interest are
$P4CLIENT, $P4PORT and $P4PASSWD.


C:\> p4 help set

set -- Set variables in the registry (Windows only)

p4 set [ -s -S service ] [ var=[value] ]

    'p4 set' sets the registry variables used by Perforce on Windows
    platforms.  Normally, the variable 'var' is set to 'value'.
    If 'value' is missing, the variable 'var' is unset.  Without
    any arguments at all, 'p4 set' list variable settings.

    The -s flag causes 'p4 set' to set variables for the whole system
    rather than for the user.  You must have NT administrator powers
    to use this.

    The -S service flag causes 'p4 set' to set variables for the named
    service.  You must have NT administrator powers to use this.

    Currently, registry variable entries may be overridden by environment
    variables and (in some cases) flags on the command line.
    See 'p4 help environment' for a list of environment/registry variables.
于 2008-11-26T22:22:21.527 に答える