Page MenuHomePhabricator

arc diff --update Created a new Differential revision not Update existing revision
Closed, ResolvedPublic

Description

I use arc diff --update to update an existing revison but arc create a new revision.

$ arc --version
arcanist c04f141ab0231e593a513356b3832a30f9404627 (9 Jun 2017)
libphutil 0a4487d37cd72b3b91ac332377f2b12d4e5a2543 (23 Jun 2017)

$ arc diff
Usage Exception: There are several revisions which match the working copy:

  • D26: readme
  • D25: readme
  • D24: readme

Use '--update' to choose one, or '--create' to create a new revision.

$ arc diff --update D24

Linting...
No lint engine configured for this project.
Running unit tests...
No unit test engine is configured for this project.
SKIP STAGING  No staging area is configured for this repository.
Updating commit message...
Created a new Differential revision:
        Revision URI: http://myphabricatoruri/D27

Included changes:
  M       README.md

It's always create a new revision which was not I wanted. Is it a bug or which configuration that I didn't set correctly?
Thank you.

Event Timeline

I am unable to reproduce this problem given the instructions provided:

epriestley@orbital ~/dev/scratch/lock-http $ arc diff
Usage Exception: There are several revisions which match the working copy:

     - D234: Test
     - D233: Test
     - D232: Test

Use '--update' to choose one, or '--create' to create a new revision.
epriestley@orbital ~/dev/scratch/lock-http $ arc diff --update D232
Linting...
No lint engine configured for this project.
Running unit tests...
No unit test engine is configured for this project.
 SKIP STAGING  No staging area is configured for this repository.
Updated an existing Differential revision:
        Revision URI: http://local.phacility.com/D232

Included changes:
  A       README.md

To move forward, we need reproduction instructions which let us reproduce the issue in a development environment. See Contributing Bug Reports and Providing Reproduction Steps.

Next steps:

  • Provide complete reproduction instructions which allow us to reproduce the issue you've observed.
  • Or, we'll close this in a few days if we still can't reproduce the problem.

I create a new empty project on my gitlab and clone it to local. And add .arcconfig file then commit it. After that I ran the arc diff command and it create a new revision on phabricator.
When I want to update the existing revision, I modify a README.md file and ran arc diff --update <Revision Number>. It's create a new revision every single time.
I'm using Mac, and it's the same on my mate's Windows computer. I don't know why.
Maybe I didn't configure currectly. So I want to know where was wrong. Here is my phabricator information.

Phabricator Version

phabricator 8008ade9af46d417aec187f4213118d220077b32 (Thu, Jun 15)
arcanist c04f141ab0231e593a513356b3832a30f9404627 (Fri, Jun 9)
phutil 74a1350416eb2df825c2315d6519bee03f77bee9 (Tue, Jun 6)

arc version

arcanist c04f141ab0231e593a513356b3832a30f9404627 (9 Jun 2017)
libphutil 0a4487d37cd72b3b91ac332377f2b12d4e5a2543 (23 Jun 2017)

git show

$ git show

Author: kai.wang <kai.wang@manaowan.com>
Date: Tue Jul 4 14:21:33 2017 +0800

add readme

Test Plan: NA

修订人: ronghai

Diff检阅修订: http://phabricator.mnw-inc.com/D33

diff --git a/.arcconfig b/.arcconfig
new file mode 100644
index 0000000..4f0be73

  • /dev/null

+++ b/.arcconfig
@@ -0,0 +1,4 @@
+{
+ "phabricator.uri" : "http://phabricator.mnw-inc.com"
+}
+
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..8178c76

  • /dev/null

+++ b/README.md
@@ -0,0 +1 @@
+readme

$ arc diff
Usage Exception: There are several revisions which match the working copy:

  • D33: add readme
  • D30: add readme

Use '--update' to choose one, or '--create' to create a new revision.

$ arc diff --update D33
Linting...
No lint engine configured for this project.
Running unit tests...
No unit test engine is configured for this project.
SKIP STAGING Unable to determine repository for this change.
Updating commit message...
Created a new Differential revision:

Revision URI: http://phabricator.mnw-inc.com/D34

Included changes:

A       .arcconfig
A       README.md

And here is the --trace information

The arc workflow is:

git branch `new-feature`
<write code>
git add -A
git commit
arc diff
<code sent to differential>

if you need to update (based on code review)

<write code, still on `new-feature` branch>
git add -A
git commit
arc diff
<updated code sent to differential>

If your code is approved

arc land

I'm not sure how or why you've gotten your local repository in that state and this doesn't sound like an issue with Phabricator. Offhand, it doesn't look like you actually committed the arcconfig.

instead of git branch once could use arc feature which does (I think) basically the same, but gives hint about what mindset to use where.

I did't add my git repositor into Diffusion. Does that matter?

Oh I see. That's the problem. I tried repositor in the diffusion, it works well.
My fault, thank you guys. This task could be close.

chad claimed this task.